twitter bootstrap 3 - CSS - Make text fit to div width and be responsive -
i want picture responsive change in page-width , picture text matching pictures width without breaking 2 lines , filling out div width.
i can't figure out. have created plunker illustrate problem: plunker - make text fit div
how can make text re-size fit picture width? know have set font-size vw in attempt make scale, make small when page shown phone, example.
please, can in how make work.
plunker code:
html:
<body> <p class="spacer"></p> <img class="img-responsive page-pic" src="https://placehold.it/800x300" /> <h3 class="page-pic-text"> abcdefghijklmnopq abc abcdefghijklmn </h3> <h1 class="page-text"> abcdefghi, abc abc abcde abcde! </h1> <br /> <br /> <br /> <br /> <br /> <br /> <h3>how make first , second text match pictures width?</h3> </body> css:
.spacer { height: 60px; } .page-pic { margin: 0 auto; width: 35%; min-width: 260px; } .page-pic-text { font-family: futura, 'trebuchet ms', arial, sans-serif; font-size: 130%; font-size: 1.357vw; font-style: normal; font-variant: small-caps; font-weight: 500; letter-spacing: 0.3em; margin: 1% auto; width: 35%; min-width: 260px; text-align: center; } .page-text { font-family: timesnewroman, 'times new roman', times, baskerville, georgia, serif; font-size: 150%; font-size: 2.2vw; font-style: normal; font-variant: normal; font-weight: 200; vertical-align: bottom; margin: 0% auto; padding-top: 3%; width: 35%; min-width: 260px; text-align: center; }
is want.change width , height need , used inline css.if want use external css , hope bootstrap working properly.i have used offline bootstrap,so not want pay attention on that.just check html.
<!doctype html> <html> <head> <title>working bootstrap offline</title> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css"> <link rel="stylesheet" type="text/css" href="index.css"> <style type="text/css"> body{ margin:0; padding:0; } .page-pic-text { font-family: futura, 'trebuchet ms', arial, sans-serif; font-size: 130%; font-size: 1.357vw; font-style: normal; font-variant: small-caps; font-weight: 500; letter-spacing: 0.3em; margin: 1% auto; width: 35%; min-width: 260px; text-align: center; } } </style> </head> <body> <div class="container-flud"> <div class="img-responsive" style="width:50%;height:50%;"> <img src="https://upload.wikimedia.org/wikipedia/commons/1/1a/bachalpseeflowers.jpg" style="width:100%;height:100%;"> <h2 class="page-pic-text" style=""> want</h2> </div> </div> <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script> <script type="text/javascript" src="js/bootstrap.min.js"></script> </body> </html>
Comments
Post a Comment