This question already has answers here:
What does a star-preceded property mean in CSS?
(4 answers)
Closed 6 years ago.
I'm using the Yahoo YUI libraries in a project. Can anyone help me understand the following CSS that I came across in the layout manager CSS:
I have been unable to figure out what the * (star) does to the declarations in the following CSS:
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {
border:1px solid #808080;
border-bottom:none;
border-top:none;
*border-bottom-width:0;
*border-top-width:0;
background-color:#f2f2f2;
text-align:left;
}
This is a hack to apply styles only to older versions of IE
the * declared styles will override the new style elements , that are unsuported by Od IE only.
http://en.wikipedia.org/wiki/CSS_filter#Star_hack
The star exploits a bug in version 7 and below of Internet Explorer and is used to make IE render your markup correctly. More information here: http://www.ejeliot.com/blog/63
Related
This question already has answers here:
CSS3's attr() doesn't work in major browsers
(5 answers)
Closed 8 years ago.
I was wondering, if I could use CSS to load a background if the attribute gets a specific class. To demonstrate, it should load on hover.
HTML
<div id="testdiv" title="http://www.thesearchagents.com/wp-content/uploads/2013/11/Google-Search.jpg">hover me...</div>
CSS
#testdiv {
line-height:100px;
}
#testdiv:hover {
outline:3px solid red;
background:url(attr(title)) 100%; // > How can I make this work?
}
#testdiv:hover:after {
content:attr(title); // > This works fine...
}
JS Fiddle
Unfortunately, no background image shows up on mouseover (hover).
(How) can I make this work?
In theory, yes:
background-image: attr(title url);
That url is a keyword telling the browser to interpret the title attribute as a URL value.
Unfortunately, such usage is experimental at best, and not supported in any major browser yet.
So currently, the answer is no, you cannot do that. Which is a shame.
This question already has answers here:
Purpose of asterisk before a CSS property
(6 answers)
Closed 9 years ago.
The question is all in the title, but if I have a rule that says
#someID{
margin-left: 10px;
*margin-left: 10px;
}
what does the *margin-left statement do?
* is useful for use as a CSS hack and Its intent is to target specific versions of IE.
The *<property> is used to target IE7 (and below).
This aticle might help you for details
This question already has answers here:
What does an asterisk (*) do in a CSS selector?
(5 answers)
Closed 9 years ago.
Ok, looking at some code in a CSS Stylesheet assigned to a project, I noticed this:
* {
margin: 0px;
padding: 0px;
text-decoration: none;
}
What does this bit do?? What elements does it effect exactly?? Strange, never heard tell of using the asterisks as a selector or whatever it is supposed to be for. What does the asterisk do exactly?
* affects (I should say "represents the qualified name of") all elements. Per spec:
http://www.w3.org/TR/selectors/#universal-selector
The asterisk is the 'universal selector' and applies the style to all elements on the page. This code will reset everything to have no margins, padding or text-decoration.
Universal selector on W3.org
It is the universal selector, much like the '$' in jQuery. It is usually used in the reset
This question already has answers here:
Purpose of asterisk before a CSS property
(6 answers)
Closed 9 years ago.
I've been using Twitter's Bootstrap package to build a site, and was browsing through the CSS when I came across the following (more or less, cruft redacted for clarity):
.btn-primary {
background-color: #006dcc;
*background-color: #0044cc;
}
Now, I've seen * used as part of the selector, both as part of a constructor like li li * { ... } and as part of an attribute selector a [name*=foo] (and obviously as part of CSS comments /* */), but I've never seen this before. Can anybody share any insight as to what it's being used for? I've also seen it in the following (complete) context:
button.btn,
input[type="submit"].btn {
*padding-top: 3px;
*padding-bottom: 3px;
}
where the * is in front of two related but distinct properties. What's going on?
This article should answer your question. It's basically a way 'hacking' CSS selectors to target a certain browser.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What does an asterisk do in a CSS property name?
I'm going through css style sheet provided with twitter bootstrap 2.0 and I see a lot of properties for which a * is appended before them. Ex: *margin-top , *zoom, *display etc..
What does this * imply ? Ex: listing of one of the rules -
audio, canvas, video {
display: inline-block;
*display: inline;
*zoom: 1;
}
direct link for bootstrap.css file
This is called a CSS hack. Its intent is to target specific versions of IE:
The *<property> is used to target IE7 (and below).
This aticle for NetTuts explains it well