In some websites for example this one, the blue box which shows various options and links such as search, chat, Questions, Tags etc. has its border stretched and fitted to the browser window.
I tried to do so in a web page which i created using div tag but i was unable to make the box stretch and fit to the browser window. Can it be done using div tag? or is there any other way for e.g. CSS?
I do not want to use jQuery or AJAX.
Yes DIV’s are prefect for making navigation menus that fill to the edge.
The most likely problem that you are encountering is the fact that you are making a DIV within another DIV that has rules.
For example
CSS
HTML
Now as you can see in the above example you have a menu within the container – now because the width of the container is 768px the menu can’t not be 1000px since 768px is the max size set by the first container.
Now there are several ways around this and by using position:absolute;
So assuming that you want your menu 100% wide to reach the edges and you want the menu at the top it would look like this in the CSS.
Lets put this to practice and see what happens so you know what to do from here on wards 😛
CSS
Here is a demo of it in example I just made: http://jsfiddle.net/9j2pa/ play around with it and get used to whats going on.
Additionally you could always move the MENU out of the container, for example: