css - How to set an element to window width without using code? -


the element's immediate parent element has width can wider window width.

i element containing paragraphs of text not require horizontal scrolling, ie width should automatically adjusted window width.

i can couple of lines of jquery code, can done css alone?

you can use vw approximate window width (its not window width, 99% of time work). css3, though. units vhand vw act percentage of viewport size. more info here: https://developer.mozilla.org/en/docs/web/css/length

heres example:

div { width: 100vw; } /* div width of viewport, or browser window (most of time)*/ 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -