Forum Moderators: not2easy

Message Too Old, No Replies

Div tag problem when resizing browser window

Text and images are coming out of div tags

         

Jamier101

3:19 pm on Oct 7, 2010 (gmt 0)

10+ Year Member



I have a div tag on my site that surrounds the page,, I have noticed that when I resize my brower the text appears to come out of the div tags and looks a mess. Does anyone know how to stop this occuring?

milosevic

4:04 pm on Oct 7, 2010 (gmt 0)

10+ Year Member



Hi, can you post either a URL or the HTML and CSS?

With this sort of issue it's difficult to give advice without seeing the actual code.

Major_Payne

4:45 pm on Oct 7, 2010 (gmt 0)



CSS:

div#selector_name {
width: #*$!px;
height: YYYpx; /* OPTIONAL */
margin: 0 auto;
overflow: scroll;
}


HTML:

<div id="selector_name">
<p>Page contents here.</p>
</div>


Selector_name is name you used to wrap the contents.

Jamier101

9:39 am on Oct 8, 2010 (gmt 0)

10+ Year Member



That works a treat, I had used a border function and I think that's why it wasn't working!

Many thanks :)

Jamier101

5:01 pm on Oct 8, 2010 (gmt 0)

10+ Year Member



If I didn't want to box my text and only have vertical lines running along the edges of the text how would I do this?

enigma1

12:53 pm on Oct 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can use the border specifics
border-left: 1px solid #000;
border-right: 1px solid #000;

Jamier101

1:06 pm on Oct 9, 2010 (gmt 0)

10+ Year Member



Would this allow the lines to run to the top of the screen or will there still be a bit of a margin at the top?

enigma1

3:24 pm on Oct 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



they will be applied to the container.

.box {
height: 100px;
width: 100px;
border-left: 1px solid #000;
border-right: 1px solid #000;
}

they apply when you use the box class for 100px in this example. If you don't specify a height they will apply to the height of the inline content.