Answer the question
In order to leave comments, you need to log in
Bootstrap + JS plugin: how to place a caption on top of an image?
There is an html page.
Lies here (SORRY, INITIALLY THE LINK WAS A BATTLE, now everything is OK):
https://dl.dropboxusercontent.com/u/28959587/pract... Connected
to it:
*Bootstrap (needed for adaptive layout)
getbootstrap.com
*Flowtype (js plugin, for responsive font)
simplefocus.com/flowtype
*Fit.js (js plugin, for centering elements)
soulwire.github.io/fit.js
Problem:
Fit.js plugin doesn't work (probably I connected it incorrectly) .
I want "Practicana" to be centered on the first image, both vertically and horizontally. Text only, no yellow background.
Just like in this picture:
https://dl.dropboxusercontent.com/u/28959587/shot.png
To do this, I'm trying to place a class="container" div (which is labeled Practicana) inside a class="row" div (which is filled with an image).
I am using this code:
<div id="welcomeimage" class="row" style="background:#FFCC66;">
<img class="img-responsive" src="http://practicana.com/img/background-02.jpg">
<div id="practicanatitle" class="container" style="text-align: center; margin: 20px auto;">
<h6 style="line-height: 1; font-family: 'Oleo Script Swash Caps', cursive; color:white;">Practicana</h6>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Try background-size:cover; , but in general, there are a lot of options, for example jsfiddle.net/26Qtx or so
<div id="welcomeimage" class="row">
<img class="img-responsive" src="http://practicana.com/img/background-02.jpg">
<div id="my_text_id" class="container">
Practicana
</div>
</div>
img {
width: 300px;
height: 300px;
}
#welcomeimage {
position: relative;
width: 300px;
height: 300px;
}
#my_text_id {
width: 100%;
position: absolute;
text-align: center;
top: 50%;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);
}
Thanks to all!
I'm still struggling with z-index and background-size...
I'm a perfectionist, so the background still doesn't work quite the way I want it to. It still does not want to fill the entire width of the window, decreasing / increasing while maintaining proportions ....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question