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 vh
and 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
Post a Comment