Solved

CSS Style for A tag, target="_blank"

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Centering a div in html5 5 47
jQuery CSS Scroll Issue 3 35
Problem to picture file 3 42
HTML CSS 7 20
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

747 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