Jump to content

Div width


Brav

Recommended Posts

I have one large div (used as container) and a few smaller in that div. Smaller divs have defined width, and width of container is based on the sum of smaller divs. Is there some way to define div so he could automatically crop it self to match resolution of the screen (div is 1381px width), or i must redefine picture used for div?

Link to comment
Share on other sites

Surely the container div can be 100% so it will resize to the size of the browser window and then the other divs presumably float on top of the container div?So the code for the container div would be:

container.div {width: 100%}

And then the code for the other divs you already have.

Link to comment
Share on other sites

if the div's are floated in the container, then they will not take up any space, and thus your div will collapse. you could add overflow: auto to the container div. or create another div that's not floated, put it after the floated elements in the HTML, and give it clear: both in the CSS.

Link to comment
Share on other sites

i don't know what you mean about the side scroll thing, but what have you tried yourself to achieve the effect? A div will take up the available width of the space its in. So you can either set that to be a percentage or a whole number in pixels. It looks like they're using a fixed width container centered on the page.

Link to comment
Share on other sites

Just found the solution :), and it was simple one :)

body {	margin:0;	padding:0;	width:100%;		background-attachment: fixed;	background-color: #2C3127;	background-image: url(../Ripped%20World/Sajt/Images/BazaWide_02.png);	background-repeat: no-repeat;	background-position: center top;}html { padding:0; margin:0;}

This will make background image, and it will be allways centered, and with the center div it will make a hole image.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...