This question already has answers here:
CSS Multistep Progress bar
(1 answer)
Build Step Progress Bar (css and jquery)
(8 answers)
Closed 5 years ago.
I have 3 images with same width and 1 image with slightly bigger width, and i want to show those images in a row, and between those images there's a connecting line horizontal in the middle, and one of the connecting line will have different color, roughly like this:
What i've done so far is i used <hr> as a connecting line but it seems not good looking enough, the connecting line not aligning vertical in the middle and when i tried to increase the font-size below each image it will make 2 row font-line not 1.
<style>
.rank-images .image-container{
width: 14%;
display: inline-block;
}
.rank-images .image-container.rank-3{
width: 18%;
}
div.seperator{
display: inline-block;
width: 12%;
}
div.seperator hr{
border-bottom: 3px solid #F7D85A;
}
div.seperator.third-seperator hr{
border-bottom: 3px solid #333;
}
.rank-images .image-container p{
margin-top: 15px;
text-align: center;
}
.rank-images .image-container p span{
font-weight: bold;
font-size: 0.73em;
color: #333;
}
</style>
<div class="rank-images">
<div class="image-container rank-1">
<img class="rank-image" src="https://cdn.pixabay.com/photo/2016/02/19/15/34/orange-1210523_960_720.png" />
<p>
<span>Less than 2000 points</span>
</p>
</div>
<div class="seperator first-seperator">
<hr>
</div>
<div class="image-container rank-2">
<img class="rank-image" src="https://cdn.pixabay.com/photo/2016/02/19/15/34/orange-1210523_960_720.png" />
<p>
<span>2001 - 5000 points</span>
</p>
</div>
<div class="seperator second-seperator">
<hr>
</div>
<div class="image-container rank-3">
<img class="rank-image" src="https://cdn.pixabay.com/photo/2016/02/19/15/34/orange-1210523_960_720.png" />
<p>
<span>5001 - 12000 points</span>
</p>
</div>
<div class="seperator third-seperator">
<hr>
</div>
<div class="image-container rank-4">
<img class="rank-image" src="https://cdn.pixabay.com/photo/2016/02/19/15/34/orange-1210523_960_720.png" />
<p>
<span>More than 12000 points</span>
</p>
</div>
</div>
Related
This question already has answers here:
Vertically align text next to an image?
(26 answers)
Closed 4 years ago.
I have added an image and text. Text has 1 <h6> and 2 <p> tags. I tried using float:left but it does not get displayed side by side.
content.js:
<div className="col l4">
<div className="card1">
<img className="javacardimg" src={java} alt="Java" height="65" width="65"></img>
<h6 className="cardtitle1">New Launch</h6>
<p className="cardcontent1">JAVA</p><p></p>
<p className="cardcontent1">Foundations</p>
</div>
</div>
<div className="col l4">
<div className="card2">
<img className="neuralcard" src={neural} alt="Neural Network" height="65" width="65"></img>
<h6 className="cardtitle2">Enroll Now</h6>
<p className="cardcontent2">Neural Newtwork</p><p></p>
<p className="cardcontent2">Foundations</p>
</div>
</div>
css:
.cardcontent{
float: left;
}
.card1 {
width: 100%;
}
.card1 > h6 {
margin: 0px;
}
I want to display New Launch JAVA Foundations on right of image similarly for card2 but current css does not work I tried few css styling but does not work.
Screenshot:
Try to use Flexbox here...and also wrap your right side content into a div for better practice and readability
.card1 {
display: flex;
align-items: flex-start;
}
h6 {
margin-top: 0;
}
.item {
padding-left: 10px;
}
<div class="card1">
<img className="javacardimg" src="http://via.placeholder.com/100x100?text=JAVA" alt="Java">
<div class="item">
<h6 className="cardtitle1">New Launch</h6>
<p className="cardcontent1">JAVA Foundations</p>
</div>
</div>
This is what I'm trying to do, in between the two pink lines is my max width.
This is what I'm getting:
I'm getting close:
This is my HTML:
<footer>
<div class="container">
<div class="row">
<div class="col-sm-6">
<h7>GET SOCIAL WITH US!</h7>
<div class="container'>
<div class="row">
<div class="col-md-2">
<img src="img/FB_LINK.png" alt="Follow us on Facebook"></div>
<div class="col-md-2">
<img src="img/TWITTER_LINK.png" alt="Follow us on Twitter"></div>
<div class="col-md-2">
<img src="img/LINKEDIN_LINK.png" alt="Link In with Us"></div>
</div>
<div class="row">
<div class="col-sm-6"><h7>© 2016 COPYRIGHT LINE</h7></div>
</div>
</div>
</div>
</footer>
This is my CSS for this section:
footer {
height: 60px;
width: 100%;
font-size: 14px;
position: absolute;
background-color: #2A3E47;
font-family: 'Contrail One', cursive;
margin: 0px 10px 0px 10px;
text-align:center;
}
footer.a{
display:inline-block;
margin:0 auto 0 auto;
}
h7{
color:#FFF;
font-size:24px;
font-family: 'Contrail One', cursive;
text-align:center;
}
I can't seem to figure this out, I've drawn it out on a couple sheets of paper, but I can seem to style like like I'd like. Can anyone point out where I'm going wrong?
After trying your the posted code I found that you are using wrong quote pair.
Also the css you gave isn't designed to achieve the goal.
I made a working fiddle here. Check it out
HTML:
<footer>
<div class="container">
<div class="row">
<div class="col-md-6 parent">
<p>GET SOCIAL WITH US!</p>
<div class="icon">
<img src="https://myapnea.org/assets/myapnea/icons/facebook_icon-7eedcb8837293505e1d3b1494ff19c9c3842340d1dfcd193e098e2b44f34456b.png" alt="Follow us on Facebook">
<img src="http://frcgamesense.com/dnn/portals/0/Home/Twitter_icon.png" alt="Follow us on Twitter">
<img src="https://store-images.s-microsoft.com/image/apps.36749.9007199266245564.6701eae8-16d2-4ba0-bdaa-8d9d9f9a1e70.03e5f6a9-3866-4ad9-9f2b-6b57ff90419e?w=100&h=100&q=60" alt="Link In with Us"></div>
</div>
<div class="col-md-6">
<p class="copyright">© 2016 COPYRIGHT LINE</p>
</div>
</div>
</div>
</footer>
CSS:
footer {
padding: 5px;
height: 100px;
width: 100%;
font-size: 14px;
position: absolute;
background-color: #2A3E47;
font-family: 'Contrail One', cursive;
margin: 0px 10px 0px 10px;
text-align:center;
}
.copyright {
padding-top: 40px;
}
footer p {
color: #fff;
}
footer a img {
display: inline-block;
width:50px;
}
.parent .icon {
margin: auto 7px;
}
It looks like your second col-sm-6 is nested too deep. It should be at the same level of the other one, not within it. Your divs are all sitting on half the grid (6 wide) and then the three social logos are taking half of that, and the copyright bit is taking the other half. You need the col-sm-6 divs to be siblings.
Furthermore, I don't think col-sm-6 looks like it'll work, looking at what you're trying to achieve. You might want to make the first group col-sm-3 or so and add an offset class to the copyright part. :-)
There are at least 3 errors in your HTML markup:
<h7>GET SOCIAL WITH US!</h7>
<div class="container'>
The ending quote should be double ("), not single (')
Since you place it in a column, the class name of this tag should be container-fluid, not container
</div>
<div class="row">
<div class="col-sm-6">
Missing close tag, the div .row is not neccessary.
</div>
</div>
</div>
<div class="col-sm-6">
Please see the fixed code here
In my html I get 'response' from controller. Number of lines in the response varies (max is 3).
What is the best way to 'reserve' 3 lines on my html page so the next div with 'SOMETHING' paragraph is not scrolled down by 'response' ?
<div class="row">
<p ng-bind-html="response"></p>
</div>
<div class="row">
<p>SOMETHING</p>
</div>
Using CSS, fix the height occupied by your 3 rows and use overflow to scroll within that fixed height div.
CSS Overflow might help you.
.row-fixed-height {
height: 150px;
overflow: scroll;
}
and in HTML:
<div class="row-fixed-height">
<p ng-bind-html="response"></p></div>
Since the height of the lines varies based on font and font size, I would use line breaks to "reserve" the three lines. If you were to use for instance a fixed height on the div or p, it might jump around on a different browser that uses a different font.
Live Demo:
#response {
background: red;
}
<div class="row">
<p id="response" ng-bind-html="response">
<br />
<br />
<br />
</p>
</div>
<div class="row">
<p>SOMETHING</p>
</div>
JSFiddle Version: https://jsfiddle.net/rspyho74/
As oori pointed you, this is is about CSS, not Angular. The easiest way to fix the height to 3 lines is using the em unit:
.row{
margin: 10px;
padding: 5px;
border: 1px solid #000;
border-radius: 5px;
}
p{
float: left;
margin: 0 5px;
padding: 5px;
border: 1px solid #000;
height: 3em;
}
<div class="row">
<p ng-bind-html="response"></p>
<p ng-bind-html="response">Line 1</p>
<p ng-bind-html="response">Line 1<br>Line 2</p>
<p ng-bind-html="response">Line 1<br>Line 2<br>Line 3</p>
<div style='clear: both;'></div>
</div>
<div class="row">
<p>SOMETHING</p>
<div style='clear: both;'></div>
</div>
As you can see, the paragraph keeps its height no matter how many lines there are. If you remove the height property you can see the difference.
The goal is that I want both images to have be side by side and centered in the middle of the row.
I tried to do that via adjusting the columns of the row
The problem is that even with trying to center via rows, it always looks a little off center and if I change the max-width to be a little bigger, the images are no longer side by side and are on top of one another
The height and width of the images are...
graft1/graft2 - height="333" width="500"
ivan1/ivan2 - height="542" width="400"
Here is my HTML
<section class="wrapper style1">
<div class="container">
<div id="content">
<!-- Content -->
<article>
<header>
<h2>Before and After</h2>
</header>
<div class="row">
<div class="div_baPics">
<img id="graft1" class="baPics" src="images/graft1.jpg" alt="">
<label for="graft1">Before</label>
<img id="graft2" class="baPics" src="images/graft2.jpg" alt="">
<label for="graft2">After</label>
</div>
</div>
<div class="row">
<div class="div_baPics">
<img id="ivan1" class="baPics" src="images/ivan1.jpg" alt="">
<label for="ivan1">Before</label>
<img id="ivan2" class="baPics" src="images/ivan2.jpg" alt="">
<label for="ivan2">After</label>
</div>
</div>
</article>
</div>
</div>
</section>
And here is the CSS for baPics
.baPics {
max-width: 30%;
}
.div_baPics {
text-align: center;
}
Since you're using Bootstrap, I went with its system. See this fiddle :
http://jsfiddle.net/Bladepianist/55gyp94n/
Well, i did use real image so that you could see the result but with that (when I tested anyway), your image should resize, following the screen.
.thumbnail {
border: none;
}
This code isn't needed, unless you don't want the border of the thumbnail ;).
Hope it will satisfy you and if that's the case, thumbs up :p.
You need to wrap img and corresponding label in a wrapper, like so:
/*Just to make a difference between pics*/
body {
background: grey;
}
/*Minimal CSS*/
.div_baPics {
text-align: center; /*Center alignment for the wrapper*/
font-size: 0; /*To remove the white space between pics*/
}
.pic {
display: inline-block;
}
.pic img {
display: block;
/*This should be set by default by Bootstrap*/
max-width: 100%;
height: auto;
}
.pic label {
display: block;
font-size: 16px; /*Or whatever font-size you use*/
}
<div class="div_baPics">
<div class="pic">
<img src="http://i.imgur.com/zNTWaR3.jpg" />
<label>Pic 1</label>
</div>
<div class="pic">
<img src="http://i.imgur.com/IqiJN2f.png" />
<label>Pic 2</label>
</div>
</div>
I am using a 2x2 grid on a wordpress page to display some images that change during a mouseover.
Using a 2 column 1 row grid, the images are perfectly horizontally aligned, but when I add a second row the bottom two images get out of alignment.
I put this code into my CSS stylesheet
.grid {
width: 704px;
margin: auto;
vertical-align: middle;
}
.grid-m1 {
float: left;
width: 22px;
height: 1px;
}
.grid-c1 {
float: left;
width: 320px;
}
.grid-m2 {
float: left;
width: 22px;
height: 1px;
}
.grid-c2 {
float: left;
width: 320px;
}
Then in my new page I put in:
<div class="grid">
<p class="grid-m1"></p>
<p class="grid-c1"><a id="top left" href="top left">
<img title="Top Left" onmouseover="this.src='http://quickfoqus.com/studies/wp-content/uploads/2013/09/Top-Left-solid.png'" onmouseout="this.src='http://quickfoqus.com/studies/wp-content/uploads/2013/09/Top-Left.png'" alt="" src="http://quickfoqus.com/studies/wp-content/uploads/2013/09/Top-Left.png" />
</a>
</p>
<p class="grid-m2"></p>
<p class="grid-c2"><a id="top right" href="top right">
<img title="Top Right" onmouseover="this.src='http://quickfoqus.com/studies/wp-content/uploads/2013/09/Top-Right-solid.png'" onmouseout="this.src='http://quickfoqus.com/studies/wp-content/uploads/2013/09/Top-Right.png'" alt="" src="http://quickfoqus.com/studies/wp-content/uploads/2013/09/Top-Right.png" />
</a>
</p>
</div>
<div class="grid">
<p class="grid-m1"></p>
<p class="grid-c1"><a id="bottom left" href="bottom left">
<img title="Bottom Left" onmouseover="this.src='http://quickfoqus.com/studies/wp-content/uploads/2013/09/Bottom-Right-solid.png'" onmouseout="this.src='http://quickfoqus.com/studies/wp-content/uploads/2013/09/Bottom-Right.png'" alt="" src="http://quickfoqus.com/studies/wp-content/uploads/2013/09/Bottom-Right.png" />
</a>
</p>
<p class="grid-m2"></p>
<p class="grid-c2">
<img src="http://quickfoqus.com/studies/wp-content/uploads/2013/09/focus-group.png" />
</p>
</div>
http://jsfiddle.net/isherwood/DZqQJ/
As you can see by looking at my site: quickfoqus.com/studies/test I cannot get these 4 images to line up properly on the grid.
I tried vertical-align tags on my css but this did not seem to work.
Thanks for the help!
Your plain gradient images have empty space at the top and side(s). Your people image does not. Here's the layout with margins applied to that image to get things lined up:
http://jsfiddle.net/isherwood/DZqQJ/1/
<img src="http://.../focus-group.png" style="margin: 10px 0 0 15px;" />