I am still a newbie to html and css, seeing as I have been working with c++ and python for quite so time, and have been having trouble with the div tag. Whenever I decalre a div tag and make the background-color: black it tends to go across the screen, is there a way to make it so that the background color does not move all the way across the screen? Also I would like to know if it is possible to make the div tag's background-color automatically go all the way down the screen, thank you.

Recommended Answers

All 5 Replies

There is an html attribute called "width". You can specify an element's width with this attribute.

Do a quick google search for css and you shall get along pretty good.

to make it go all the way down the screen there's a trick:

<div style="width:500px;top:0;bottom:0;margin:auto;">&nbsp;</div>

Speaking of CSS, is there a way to make to background images and align them at different sides of the page?

You can use <div></div> s to locate two images wherever you want in the page and use them as backgrounds using the position:absolute; property.

Actually I just defined a background in HTML then CSS, but thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.