Solved

CSS Style for A tag, target="_blank"

Posted on 2010-11-23
3
490 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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 …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

705 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