Saturday, August 16, 2014

We continue to adapt! Today we look at how to adapt the content of the site. Enjoying the demo here


We continue to adapt! Today we look at how to adapt the content of the site. Enjoying the demo here. Will adapt: video - to adapt the video, you need to put it in a container with a specific css rules. .video-container {position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; The video itself}, nammo usually connected via tags iframe, object or embed also add properties to them. .video-container iframe, .video-container object, nammo .video-container embed {position: absolute; top: 0; left: 0; width: 100%; height: 100%; All} Now just put the video into a container and nathnyaemsya <div nammo class = "video-container"> <iframe src = "http://www.youtube.com/embed/OlA9-bdFq1I" frameborder = "0" allowfullscreen> </ iframe> </ div> If you want to limit the size of the video (for example that it does not get out beyond the width of 600px), just add another block. .video-wrapper {width: nammo 600px; max-width: nammo 100%; And there} put our container: <div class = "video-wrapper"> <div class = "video-container"> <iframe src = "http://www.youtube.com/embed/OlA9-bdFq1I" frameborder = "0" allowfullscreen> </ iframe> </ div> </ div> Max-width nammo - sets the maximum width of the element, for example, make the container occupies 600px if possible, if it is impossible to only 90% of the width and batski.Kambinatsyya max- width gives the desired result: nammo .container {width: 600px; max-width: 90%; } Image - 2 lines and we have adapted the image. img {max-width: 100%; height: auto; } Min-width - sets the minimum width, such as form fields, nammo it is convenient to set a minimum width, on which the form will not shrink. Css: form {min-width: 450px; } Form input {max-width: 100%; } Html: <form> <input type = "text"> </ form> The relative spacing. - Just ask margin in% instead of px. The same (set in%) and padding: Relative font - we know that the elements take the size shryvta inherited from his father. Therefore, we just give the desired value font-size element in html. For example, the width of the browser for more than 1367px - Font 120%, from 768 to 1366 - 100% Smartphone below 768px - 80%. / * Large desktop * / media (min-width: 1367px) {html {font-size: 120%; }} / * Portrait tablet to landscape and desktop * / media (min-width: 768px) and (max-width: 979px) {html {font-size: 100%; }} / * Landscape phone to portrait tablet * / media (max-width: 767px) {html {font-size: 80%; }} Watch: Overflow: hidden - we have an image float: left and have a div with text, and we want to keep and get rid of the hierarchy abtsekannya text image. Exhibit div property overflow: nammo auto. img {float: left; } Div.text-container {overflow: auto; } Word-break Sometimes the word is long (for example url) and get out of the unit. Just expose block property word-wrap: break-word; Looks like this:


No comments:

Post a Comment