A Conversation for Website Developer's Forum
CSS question - custom style taking precidence
HappyDude Posted Nov 22, 2002
try using padding insyead of margin.
and you want Clear examples eh...
so you read post 19 (or even post 3)?
CSS question - custom style taking precidence
HappyDude Posted Nov 22, 2002
Take a llok at http://happy.sdf-eu.org/test/index.html and see tthe NS4 solution I've come up with
CSS question - custom style taking precidence
C Hawke Posted Nov 22, 2002
..as I said it was the links in post 19 that made the placement thing so clear.
Looking at your other link now, thought about padding, but must have got sidetracked this PM at work as never got round to trying it.
Cheers
CH
CSS question - custom style taking precidence
HappyDude Posted Nov 22, 2002
It's an example of degradation - still need a bit of work (should be updating late Sunday/early Monday) so take another look Monday morning
CSS question - custom style taking precidence
Ion the Naysayer Posted Nov 23, 2002
"larger" maps properly in most browsers. If you explicitly set the text size for the body element, "larger" and "smaller" work wonderfully when defining footnotes, headings, etc..
I tend not to use absolute font sizes just as a personal preference.
Regarding specifying a minimum or maximum size for a div, you can use (min|max)height and (min|max)width. Here's the catch - it doesn't work in Internet Explorer. Thank you Microsoft.
A word of warning: Mixing percentage and absolute positioning is potentially dangerous. It will likely not look like you want it to and you may end up with extraneous scrollbars and other oddities, especially if you have margins and padding defined.
Here's another potential "gotcha": Margins are _added_ to widths, not subtracted from them! If you have 3% margins and your divs are 30% and 70% respectively, your page will be 106% of screen width (except in IE which is broken here as well). Be sure to define margins appropriately.
If you feed NS4 certain CSS it will fail to render correctly or even crash (!). As far as Netscape 4 goes, I send it a bare unstyled page with a little note that the site looks much better in a browser that sucks less. Okay, I'm not quite that blunt but that's the gist of it. Check out http://www.webstandards.org/act/campaign/buc/tips.html for an example of browser detection that won't break.
CSS question - custom style taking precidence
HappyDude Posted Nov 23, 2002
on the above note Top Style Lite
apart from being free is excellent in that as well as selecting CSS by level you can select by browser.
__________________
http://happy.sdf-eu.org/test/index.html
Had some time on my hands so updated.
the basic CSS is from the W3C core styles (http://www.w3.org/StyleSheets/Core/). These are good as a style sheet optimised for the browser or device used for viewing the page is used.
Next is the CSS for Printing - This hides the logo & navigation so only the Content is printed.
There is a tiny bit of CSS on the page that modifies the W3C Core Style
Older browser such as NS4 will use only these style sheets.
Finally for Modern browsers there is another style sheet, which gives a (IMHO) pretty layout
CSS question - custom style taking precidence
C Hawke Posted Nov 26, 2002
and now sorted the degrading NS4.x thing - saw your site but didn't suss why it worked till I read http://www.mako4css.com/csstwo.htm - always like to do things I know more or less how they work rather than simply copying.
Now pages - table only used for banner graphics, the relevant links as text and layout of actual content in DIVs.
CH
CSS question - custom style taking precidence
C Hawke Posted Nov 27, 2002
ARRRGGGHHH. Now I come to define in my CSS the style for the links elsewhere in my site and this then totally over-writes the classes/divs set for the links I wanted to different!!!!
I give up, anyone know of a job in a field working with sheep?
CH
CSS question - custom style taking precidence
C Hawke Posted Nov 27, 2002
Arh, now I see, I have to specify the ful range in the CSS thus
a.headertext:link {
font-family: Arial, Helvetica, sans-serif;
font-size: 9pt;
background-color : #ff0000;
color: #FFf;
text-decoration : none;
}
a.headertext:visited {
font-family: Arial, Helvetica, sans-serif;
font-size: 9pt;
background-color : #ff0000;
color: #FFf;
text-decoration : none;
}
a.headertext:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 9pt;
background-color : #ff0000;
color: #FFf;
text-decoration : none;
}
Of the things I want different to the default.
Still looking for a sheep based job.
CH
CSS question - custom style taking precidence
C Hawke Posted Nov 27, 2002
but as no sheep....how do you use the same DIV definition again and stay "legal" I have a DIV defined in the CSS that places a float box on the screen, works well, and I can use it more than once (<div id="rightbox"> but if I do the w3c validator thows it out as I have used the same ID twice!
DOh! don't answer, found this
http://codepunk.hardwar.org.uk/acss06.htm using class and id together with my divs - is this the best way?
BTW - what your opinions on WebSafe coulrs?
Chris
CSS question - custom style taking precidence
HappyDude Posted Nov 27, 2002
websafe - if you want to be safe and have total control use 'em, but I these days there is no real need to use them.
no solution to reusing
you will have to put the code in your style sheet multiple times with slightly differnt names.
CSS question - custom style taking precidence
Frankie Roberto Posted Nov 27, 2002
Use class="" instead of id??
CSS question - custom style taking precidence
HappyDude Posted Nov 27, 2002
could do but that raise other questions
try subscribing to
http://two.pairlist.net/mailman/listinfo/css-discuss
it's the best place I know of for CSS advice
CSS question - custom style taking precidence
dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC Posted Nov 27, 2002
Using class instead of ID should work fine for most things, with no difference in the appearance. ID should be used for things like positioning because generally you only want one thing in one place anyway.
Of course you can further differentiate styles without using at all, by compounding the tags like this
p a:hover { color: red }
// only affects links within paragraphs
b a:hover { color: red; font-weight: bold }
// only affects links within bold tags
li a:hover {...}
etc.
I was just playing with colors yesterday. It seems that if you do not use web safe colors, there are still marked differences between Mac and Windows even with stylesheets. Theoretically web safe is not needed because everything displays with thousands or millions of colors nowadays anyway, but it doesn't hold true.
CSS question - custom style taking precidence
Ion the Naysayer Posted Nov 27, 2002
Think of ids as a primary key - it's for identifying a given section. Think of class as a style type - it's for defining what a section should look like. I usually assign ids based on what the content of the div is, e.g. or .
CSS question - custom style taking precidence
C Hawke Posted Nov 28, 2002
I don't normally post work links here but as you lot had a large impact on how I did it here is the test page I have been working on.
http://www.swro.info/index_new.asp
Any comments (apart from the fact I use a table for the top navigation, and Javascript for the menus - still works without script enabled as the headers will take you to an index page, so users will get to the right place but will have one extra page to go via)
Cheers all.
Chris
CSS question - custom style taking precidence
C Hawke Posted Nov 28, 2002
...and the fact it looks pants in NS4.x - still working on that.
Key: Complain about this post
CSS question - custom style taking precidence
- 41: HappyDude (Nov 22, 2002)
- 42: HappyDude (Nov 22, 2002)
- 43: C Hawke (Nov 22, 2002)
- 44: HappyDude (Nov 22, 2002)
- 45: Ion the Naysayer (Nov 23, 2002)
- 46: HappyDude (Nov 23, 2002)
- 47: C Hawke (Nov 26, 2002)
- 48: HappyDude (Nov 26, 2002)
- 49: HappyDude (Nov 26, 2002)
- 50: C Hawke (Nov 27, 2002)
- 51: C Hawke (Nov 27, 2002)
- 52: HappyDude (Nov 27, 2002)
- 53: C Hawke (Nov 27, 2002)
- 54: HappyDude (Nov 27, 2002)
- 55: Frankie Roberto (Nov 27, 2002)
- 56: HappyDude (Nov 27, 2002)
- 57: dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC (Nov 27, 2002)
- 58: Ion the Naysayer (Nov 27, 2002)
- 59: C Hawke (Nov 28, 2002)
- 60: C Hawke (Nov 28, 2002)
More Conversations for Website Developer's Forum
Write an Entry
"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."