Help with CSS
Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.
Help with CSS
#1
Posted 22 April 2007 - 10:36 AM
#2
Posted 22 April 2007 - 10:44 AM
I think the * is just an IE hack...
For example, if you have this html:
<div id="fish">
The CSS to reference it is #fish
If the HTML was this instead:
<div class="fish">
The CSS would be .fish not #fish.
Does that make sense?
#3
Posted 22 April 2007 - 12:07 PM
I read a lot about 'hacks'. What does this actually mean? Is it a sort of cheat, or a way to overcome some sort of problem with a specific browser. Are 'hacks' a good or bad thing? If I were to look at a specofic template designed by someone else, or a webpage/site etc. how would I know whether it is constructed using 'hacks'?
#4
Posted 22 April 2007 - 12:18 PM
king213, on Apr 22 2007, 01:07 PM, said:
I read a lot about 'hacks'. What does this actually mean? Is it a sort of cheat, or a way to overcome some sort of problem with a specific browser. Are 'hacks' a good or bad thing? If I were to look at a specofic template designed by someone else, or a webpage/site etc. how would I know whether it is constructed using 'hacks'?
Hacks take advantage of 'certain' browsers' inability to parse css like other browsers, and therefore allow you to aim some styles at one browser, and other styles at other browsers. It is, though, a lazy way of browser-filtering your css.
It's obvious that some browsers need different css properties than others, simply because they render css values differently. The default line-height, for example, is different in IE, than it is in Safari.
The best way to send some CSS to one browser, and other CSS to another browser, is through the use of conditional comments. They are for Internet Explorer (all versions, uniquely) only, because they tend to be the only browser(s) you need to send different css values too.
Read more about conditional comments here: http://www.quirksmod...ss/condcom.html
#5
Posted 22 April 2007 - 12:22 PM
#6
Posted 23 April 2007 - 04:57 AM
* {
margin: 0;
padding: 0;
}
The above code sets the margin and padding on every element to zero. It's not a hack by any means.
#7
Posted 23 April 2007 - 09:26 AM
Ryan Fait, on Apr 23 2007, 10:57 AM, said:
* {
margin: 0;
padding: 0;
}
The above code sets the margin and padding on every element to zero. It's not a hack by any means.
Hey, thanks for that too. I am learning a lot and have been studying up on the subjects. Will come back to you on this as the days unfold. Undoubtedly there are bound to be further related issues that don't make sense to a relative 'newbie' such as myself!!
#8
Posted 23 April 2007 - 11:14 AM
#9
Posted 23 April 2007 - 12:58 PM
herkalees, on Apr 23 2007, 05:14 PM, said:
Well, as yet I'm certainly no expert, but given time I'd like to learn as much as possible about this subject, because it's very interesting. Problem is, there's never enough time! I don't expect that I'll ever know as much as you guys, in fact I can't begin to imagine how long you've been studying the subject to know as much as you do.
When it comes to building a website, or anything else for that matter, there is no point in doing half a job. It's the not knowing how to do certain things that really frustates me, and it's this frustration that motivates me to learn more. Eventually, hopefully, I will be the proud owner of a website/s that I built from the bottom up, using the correct methods.
Most of all, I'd like to say a great big thankyou to all of the members of this forum who have helped me so far. I'm certain that there will be many more questions over the coming weeks and months!!
#10
Posted 15 May 2007 - 02:20 PM
You should not use hacks, instead you should use IE conditional comments.
<!--[if IE 6]>
<link rel="stylesheet" href="css/ie6.css" media="screen" type="text/css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="css/ie7.css" media="screen" type="text/css" />
<![endif]-->
Alterantely #is an ID which can only be used once per page and .Foo is a class which can be used as many times as you want.
#11
Posted 16 May 2007 - 08:29 AM
#content *
which will select everything underneath content.
* html
the ie hack works because the root element of the DOM is HTML. So how can the root element be a child of another element which is what
* html
would be. Anything that is the parent of the html. IE incorrectly applies this style.
Think of hacks as filters that allow you to filter out browsers who either do not understand the selector through a css deficiency, or where they incorrectly apply the selector. I'd have to concur that hacks should not be used in favor of conditional comments.
#12
Posted 24 September 2011 - 01:19 PM


Help
MultiQuote












