Solved

CSS Style for A tag, target="_blank"

Posted on 2010-11-23
3
483 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS grid style change 2 33
Glitch when viewing from computer to mini-window(smartphone) 1 43
Problem to page 4 69
text on slider doesn't resize nicely 5 37
Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
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 …
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…

930 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now