Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Avoiding Div-mania using css
Old 01-14-2009, 08:35 AM Avoiding Div-mania using css
Defies a Status

Posts: 1,605
Trades: 0
This is very similar to this thread http://www.webmaster-talk.com/css-fo...sitioning.html but I did not want to hijack the thread. If you choose to merge I agree.

I know the following will work. Since this code will be repeated more than once on the same page I am concerned that I am creating a div mania page when the there is a more proper way to do the same thing. I mean compared to tables, tr and td to do the same thing it is very simple code.

This code deals with a single column of a page and is comprised of a full width image at the top, bottom and a bg image to fill in the content area.

<div> <!-- column width defined in SS -->
<div><img src="./images/top.png" /> </div>

<div> (bg image set in stylesheet)

content as desired fluid height.

</div>

<div><img src="./images/bottom.png" /> </div>

</div> <!-- (the column) -->
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-14-2009, 10:35 AM Re: Avoiding Div-mania using css
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
As long as you use classes to define the properties of the divs inside the columns, that's really not div mania at all. Although, if you're just using the divs to hold images in the HTML, then the div may not be necessary at all, you could put a class on the image itself. Depends on exactly what you're doing there.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 12:48 PM Re: Avoiding Div-mania using css
Defies a Status

Posts: 1,605
Trades: 0
Quote:
class on the image itself
Suggested reading?
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 03:44 PM Re: Avoiding Div-mania using css
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Just define your css properties - margins, padding, dimensions, as a class, then add the class to the <img> statement, like this:

<img class="imgBlock" src=...................... />

CSS example:
.imgBlock{display:block; margin: 8px auto; padding: 3px;}
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Avoiding Div-mania using css
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13202 seconds with 12 queries