Solved

CSS Style for A tag, target="_blank"

Posted on 2010-11-23
3
487 Views
Last Modified: 2012-05-10
I would like to add an effect to any link that opens target _blank.  I would prefer to use only CSS to do this, but all the help I have found is dated in 2004 or earlier.  I have to assume there is a way to do this with today's browsers (or at least IE7 and newer).

Is there a css funtion that can specifically attach to any a tag that has a target of _blank?
Idea of coding would be something like:

a target(_blank) {
     font-size: 16px;
}
0
Comment
Question by:mopar003
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 34200084
The following works in Chrome and Firefox, doesn't appear to work with IE though:

      a[target="_blank"] { font-size: 16px; }
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34200118
Correction, it also works in IE7 and IE8 as long as you're not in "quirks" mode.
0
 
LVL 14

Expert Comment

by:Designbyonyx
ID: 34200304
Just a note ( no need to give me credit for answering ) - the quotes are not necessary:

a[target=_blank]

And here is a great page describing everything you can do with "Attribute Selectors":

http://css-tricks.com/attribute-selectors/
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question