html - Vertically center border on paragraphs -
i trying vertically center border around 'about' div class containing 3 paragraphs. border high, want move down vertically center it. can adjust height can't move border down @ all.
<div class='about'> <p> javascript (/ˈdʒɑːvəˌskrɪpt/[5]) high-level, dynamic, untyped, , interpreted programming language. </p> <br> <p> despite naming, syntactic, , standard library similarities, javascript , java otherwise unrelated , have different semantics. </p> <br> <p> javascript used in environments not web-based, such pdf documents, site-specific browsers, , desktop widgets. </p> <br> </div>
here css
.about { width: 500px; text-align: center; margin: auto; padding-top: 50px; border-right: 1px solid white; border-left: 1px solid white; padding-right: 15px; padding-left: 15px; height: 200px; }
it difficult visualize need without looking @ complete code on jsfiddle: https://jsfiddle.net/njh5scyd/
please help! been trying figure out...
thank you
you should :after
, :before
pseudo-elements:
/*main.css*/ html, body, h1, h2, h3, h4, div, p, ul, ol, li { padding: 0; border: 0; margin: 0; font: inherit; font-size: 100%; font-family: 'helvetica neue', 'helvetica', 'sans-serif'; color: white; background-color: black; } h1 { font-size: 70px; font-weight: bold; text-align: center; } h2 { font-size: 22px; font-weight: 200; text-align: center; border-bottom: 1px solid white; padding-bottom: 10px; } h2 strong { font-weight: 500; } .tagline { padding: 15px 0 25px 0; width: 700px; margin: 0 auto; } .links ul li { display: inline; padding: 20px; font-weight: bold; } .links { text-align: center; } .links { text-decoration: none; color: white; text-decoration: underline; } .about { width: 500px; text-align: center; margin: auto; padding-top: 50px; padding-right: 15px; padding-left: 15px; position: relative; } .about:before { position: absolute; left: 0; top: 50%; transform: translatey(-50%); height: 50%; border-left: 1px solid white; content: ''; } .about:before { position: absolute; right: 0; top: 50%; transform: translatey(-50%); height: 50%; border-right: 1px solid white; content: ''; }
<body> <div class='header'> <h1>daffy duck</h1> </div> <div class='tagline'> <h2>fdsfsdfsdfsdfds <strong>fewfwefwef</strong> fdsfdsfsdf <strong>sdfdfsf</strong></h2> </div> <div class='links'> <ul> <li><a href='file:///users/frank/desktop/moee.html' target='_self'>home</a></li> <li><a href='file:///users/frank/desktop/javascrip.html' target='_self'>portfolio</a></li> <li>resume</li> <li><a href='file:///users/frank/desktop/game.html' target='_self'>about</a></li> <li>why me</li> </ul> </div> <div class='about'> <p> javascript (/ˈdʒɑːvəˌskrɪpt/[5]) high-level, dynamic, untyped, , interpreted programming language.[6] has been standardized in ecmascript language specification.[7] alongside html , css, 1 of 3 essential technologies of world wide web content production; majority of websites employ , supported modern web browsers without plug-ins. </p> <br> <p> despite naming, syntactic, , standard library similarities, javascript , java otherwise unrelated , have different semantics. syntax of javascript derived c, while semantics , design influenced self , scheme programming languages. </p> <br> <p> javascript used in environments not web-based, such pdf documents, site-specific browsers, , desktop widgets. newer , faster javascript virtual machines (vms) , platforms built upon them have increased popularity of javascript server-side web applications. </p> <br> </div> </body>
Comments
Post a Comment