Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

div element width with css

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Related Topics:
CSS min-width for IE? - Hi guys. I want to use on a new site to prevent the being ruined in a window smaller than 640px across. body { 640px; } Works great in Opera, as all good things do, but has no effect in IE 6. Anybody know of a work..

Layout width - What width do all you people design to these days? I don't mean screen size, i mean actual width. cheers, -ciaron

Page Width - Is there any way of setting the page width to account for all I ask this because my cancer website is utilized by people that may, or may not, have visual These people may have their computers set up to give them the highest..

improper use of width and hieght? - Sometimes staff on my site send me html reports for and I have noticed that they use width and hieght to resize large images so they appear as This isn't something I do, if I need I create and link them to..

Text to span column width? - Hi, is it possible to size a line of text to span from one side of a column to the other? Does that make sense? Thanks - Joe
Next:  Webmaster: Pretty print with PHP?  
Author Message
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 1) Posted: Fri Aug 13, 2004 8:17 pm
Post subject: div element width with css
Archived from groups: alt>www>webmaster (more info?)

OK, I have the following:

#elem{
position: absolute;
top: 85px;
left: 100px;
height: 76px;
color: #000;
background-color: #9AB9D6;
}

I want the width of it to be 100%-100px - Is this possible?

"width: auto;" didn't work, the background-color wasn't applied across
the page. "width: 100%;" creates a nice vertical scroll bar - at all
resolutions.

--
Justin Koivisto - spam.RemoveThis@koivi.com
http://www.koivi.com

 >> Stay informed about: div element width with css 
Back to top
Login to vote
spam19

External


Since: May 08, 2004
Posts: 952



(Msg. 2) Posted: Fri Aug 13, 2004 8:17 pm
Post subject: Re: div element width with css [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 13 Aug 2004 17:17:36 GMT, Justin Koivisto <spam DeleteThis @koivi.com> wrote:

 > OK, I have the following:
 >
 > #elem{
 > position: absolute;
 > top: 85px;
 > left: 100px;
 > height: 76px;
 > color: #000;
 > background-color: #9AB9D6;
 > }
 >
 > I want the width of it to be 100%-100px - Is this possible?

Div's are 100% by default... but collapse by default when you specify
position absolute.

You could try (none of these tested):

- Putting the positioned div in another div with 50px margins on either
side, then specifying 100% width, hoping the 100% means the containing div
rather than the viewport.

- Setting position:relative; and seeing if a 100px margin works then

- Reconsider the use of the position property in this design...

That's as helpful as I can be OOC.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: div element width with css 
Back to top
Login to vote
spamblocked

External


Since: Sep 14, 2004
Posts: 588



(Msg. 3) Posted: Fri Aug 13, 2004 9:22 pm
Post subject: Re: div element width with css [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Justin Koivisto wrote:

 > OK, I have the following:
 >
 > #elem{
 > position: absolute;
 > top: 85px;
 > left: 100px;
 > height: 76px;
 > color: #000;
 > background-color: #9AB9D6;
 > }
 >
 > I want the width of it to be 100%-100px - Is this possible?

don't think so

 > "width: auto;" didn't work, the background-color wasn't applied across
 > the page. "width: 100%;" creates a nice vertical scroll bar - at all
 > resolutions.
 >

I guess there is no problem with the content - it's the background that is
causing trouble right? Perhaps a containing div with the relevant
background properties set would do it for you.

Tricky to tell unless you say what you're really trying to achieve.

--
William Tasso
Recommended reading ...
<a style='text-decoration: underline;' href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a>
<a style='text-decoration: underline;' href="http://www.aww-faq.org/" target="_blank">http://www.aww-faq.org/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: div element width with css 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 4) Posted: Fri Aug 13, 2004 9:53 pm
Post subject: Re: div element width with css [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Justin Koivisto wrote:

 > OK, I have the following:
 >
 > #elem{
 > position: absolute;
 > top: 85px;
 > left: 100px;
 > height: 76px;
 > color: #000;
 > background-color: #9AB9D6;
 > }
 >
 > I want the width of it to be 100%-100px - Is this possible?
 >
 > "width: auto;" didn't work, the background-color wasn't applied across
 > the page. "width: 100%;" creates a nice vertical scroll bar - at all
 > resolutions.
 >

erg.. it was just a background fill, so I pushed it to the bottom of the
document and used left: 0; instead.

Sometimes I just can't think right before lunch.... Wink

--
Justin Koivisto - spam DeleteThis @koivi.com
<a style='text-decoration: underline;' href="http://www.koivi.com" target="_blank">http://www.koivi.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: div element width with css 
Back to top
Login to vote
usenet200408

External


Since: Aug 02, 2004
Posts: 145



(Msg. 5) Posted: Fri Aug 13, 2004 10:24 pm
Post subject: Re: div element width with css [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Justin Koivisto wrote:

 > #elem{
 > position: absolute;
 > top: 85px;
 > left: 100px;
 > height: 76px;
 > color: #000;
 > background-color: #9AB9D6;
 > }
 >
 > I want the width of it to be 100%-100px - Is this possible?

With an absolutely positioned element? No, don't think so. Nest.

<div id="elem"><div>lala</div></div>

#elem{
position: absolute;
top: 85px;
left: 0px;
height: 76px;
width: 100%;
}
#elem div {
color: #000;
background-color: #9AB9D6;
margin: 0 0 0 100px;
width: 100%;
height: 76px;
}


--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ <a style='text-decoration: underline;' href="http://tobyinkster.co.uk/contact" target="_blank">http://tobyinkster.co.uk/contact</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: div element width with css 
Back to top
Login to vote
usenet200408

External


Since: Aug 02, 2004
Posts: 145



(Msg. 6) Posted: Fri Aug 13, 2004 10:25 pm
Post subject: Re: div element width with css [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Toby Inkster wrote:

 > #elem div {
 > color: #000;
 > background-color: #9AB9D6;
 > margin: 0 0 0 100px;
 > width: 100%;
 > height: 76px;
 > }

width:auto; Duh.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ <a style='text-decoration: underline;' href="http://tobyinkster.co.uk/contact" target="_blank">http://tobyinkster.co.uk/contact</a>
Now Playing ~ ./u2/best_of/04_i_still_havent_found.ogg<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: div element width with css 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]