The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Make a DIV element the width of the page
jeak
post Jun 20 2012, 09:09 AM
Post #1





Group: Members
Posts: 2
Joined: 20-June 12
Member No.: 17,294



I have a DIV element at the top of my page, and another beneath. I'd like the top DIV to always cover the entire width of the page, even if the browser window width is less than the width of the second DIV element. How would I do this? Sample of what I'm currently doing below.

<html>
<body style="padding:0px; margin:0px;">

<div style="background-color:#123456; width:100%;">top</div>
<div style="background-color:#654321"><IMG style="width:1000px; height:1000px;"></div>
</body>
</html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Frederiek
post Jun 21 2012, 06:52 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 4,331
Joined: 23-August 06
From: Europe
Member No.: 9



You're welcome.


--------------------
"The earth does not belong to us. We belong to the earth."
from Vue du ciel (in French)

"Leave scepticism to others and take action"
from HOME by Goodplanet

An inconvenient truth by Al Gore
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic
jeak   Make a DIV element the width of the page   Jun 20 2012, 09:09 AM
Frederiek   Set a min-width of say 100em to the top div.   Jun 21 2012, 02:18 AM
jeak   Brilliant, thank-you.   Jun 21 2012, 06:47 AM
Frederiek   You're welcome.   Jun 21 2012, 06:52 AM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 2nd September 2014 - 01:43 AM