CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 1st, 2001, 07:19 AM
reptile reptile is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Switzerland
Posts: 64 reptile User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m
Reputation Power: 12
CSS - What is good style?

In another thread, I read about mixing font tags and CSS, especially that this is considered messy.

My problem is that, so far, I did not manage to create a pure CSS layout that was really accurate to the single pixel afterwards. Example: I was not able to specify the exact indent after a header tag, <h1> etc, such as that it looked the same in all popular browsers. Moreover, I had different blocks of "plain text" that had to be displayed differently (article text, comment text, etc). That is, I still needed some markup for these text blocks in order to assign them a specific layout.

A solution which I found rather elegant was using different CSS classes:

Code:
<!-- css -->
.title {font-weight: bold; font-size: 16pt; margin-bottom: 10px}
.text {font-size: 11pt}
..

<!-- body -->
<font class="title">My title</font>
<font class="text">Blah, blah</font>


Using these font tags, I still have all my layout definitions in one single file. Clean, isn't it? Or had I rather use <div> tags?
And still, I wonder if I have misunderstood the CSS concept.

Any opinions? I'd really like to discuss this and hear what some CSS-experienced people have to say.

Reply With Quote
  #2  
Old August 1st, 2001, 09:52 AM
szarecor szarecor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: New York
Posts: 122 szarecor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
reptile:

Four points:
1. defining your own classes is the way to go. You can also associate style definitions with element id's using the '#' symbol. For example,
#title {font-weight: bold; font-size: 16pt; margin-bottom: 10px}
Would style an element with the id of "title" rather than "class".

2. Browser support for things like indents, line-heights, etc. is very poor, so don't be too worried - we're all suffering under the same limitations.

3. As you have guessed, you should be using <span>, <div>, and <p> tags rather than <font> tags.

4. It seems like you have a pretty firm grasp of the css concept.

Good luck

Reply With Quote
  #3  
Old August 3rd, 2001, 06:53 AM
reptile reptile is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Switzerland
Posts: 64 reptile User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m
Reputation Power: 12
Thanks, this is reassuring .
I will eliminate my font tags one by one, then.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS - What is good style?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap