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
how do you edit your block level elements?
Old 10-10-2007, 05:58 PM how do you edit your block level elements?
beta's Avatar
Extreme Talker

Posts: 169
Trades: 0
Hi, im working on something now where i would like to give quite a few block level elements like h1 and div tags their own background color and am getting a bit frustrated with the default width.

ive tried changing them to display: inline and floating them but there is allways negative effects. What is the best way to get control over the width, bearing in mind there are some headers and text which i would like to resize with text resize so i cant really use width:

thanks!
beta is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-11-2007, 01:21 AM Re: how do you edit your block level elements?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Did you try clearing your floats after you were done with them? Usually that's why people fail with floats.

You could cheat the issue a bit, if the background color is that important to you, by doing something like this:
Code:
h1 span {
     background-color:  #000000;
}
...
...
Code:
<h1><span>This is where your header goes, with a black background color</span></h1>
Since span is an inline element by default, you'll probably get the effect you want.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 10-11-2007, 01:49 AM Re: how do you edit your block level elements?
beta's Avatar
Extreme Talker

Posts: 169
Trades: 0
Its a good way yeah, i think i will hold it as a last resort.

The problem i have with floats is that i usually end up floating all the parent containers all the way back to body most of the time just to keep the layout, and im trying to avoid that too...
beta is offline
Reply With Quote
View Public Profile
 
Old 10-11-2007, 03:27 PM Re: how do you edit your block level elements?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
The problem i have with floats is that i usually end up floating all the parent containers all the way back to body most of the time just to keep the layout, and im trying to avoid that too...
That's not necessary, you must be doing something else that's making you have to do that.
__________________
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 10-15-2007, 12:33 PM Re: how do you edit your block level elements?
beta's Avatar
Extreme Talker

Posts: 169
Trades: 0
aaahhh! noooo! i knew it would come to this. I was hoping for a legal quick fix and every one of you guys posts reminds me that there is no way to get round it other than learn floats properly... why do you have to be so right?!?!
beta is offline
Reply With Quote
View Public Profile
 
Old 10-15-2007, 12:36 PM Re: how do you edit your block level elements?
l3lueMage's Avatar
Skilled Talker

Posts: 73
Location: San Jose, California
Trades: 0
Because then you wouldn't learn the right way?
l3lueMage is offline
Reply With Quote
View Public Profile
 
Old 10-16-2007, 04:30 AM Re: how do you edit your block level elements?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
other than learn floats properly.
That IS the "legal" quick fix
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to how do you edit your block level elements?
 

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.56866 seconds with 12 queries