Multiple text lines next to the image wont work - html

I am trying to add text next to the image. The tag stands in prefered position, but when I use tag, the second line goes under the image. I found lots of similar questions in google, but non works for me. Here is the code:
#quality {
float: left;
margin-right: 10px;
padding: 20px;
}
#security {
padding-bottom: 10px;
}
<div id="quality">
<div id="security">
<img src="img/security.png">
<h3>Title</h3>
<br>
<span>Sample text is here</span>
</div>
</div>

Remove the br tag after h3.
Try this html:
<div id="quality">
<div id="security">
<img src="img/security.png">
<div class="rightDiv">
<h3>Title</h3>
<span>Sample text is here</span>
</div>
</div>
</div>
add CSS:
#security img, #security .rightDiv{
display:inline-block;
vertical-align: top;
}

Use float for the image and the content you want to be next to it. Try the fiddle below:
#quality {
float: left;
margin-right: 10px;
padding: 20px;
}
#security {
padding-bottom: 10px;
}
img{
float: left;
}
.text-container{
float: left;
}
<div id="quality">
<div id="security">
<img src="https://8biticon.com/static/8bit/img/male/background4.png">
<div class="text-container">
<h3>Title</h3>
<br>
<span>Sample text is here</span>
</div>
</div>
</div>

try this
[demo]
html
<div id="quality">
<div id="security"> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAABX1BMVEX////qQjVChvU0qFP6vAX//v+oxPg3f/X///0mevT///z8//9Bhvf1+f3pQzX//f/5twA0qFXqQzM0qU9Bh/P/vwD3tKvlKBDqJAvsQjL6tQD4vgXpOy3uQTb///kdo0RBgv/pNSXnQzkxf/Xq9u0IoT7E4sxbk/VZtHOIy5Zsv37J2v2t2LXY7+fh8OGavvd3xIzV79y43MGEr+n8569EitXCtiIQplratRmm1LO10Pw9qU3ouRH+++xNjfV6pfePsvWKrzv72Ybk7/z7y0uotC1urUH99Nhrn/r9z1pRqUr6yTdGsGMUnUUIojeYz6SYv+s1onI8kbs8m4k/lqgyrDg/iuM+j842pWE7maDh5v7xfHXxaF7yiIX51s364+DucmjyYl/2paD4wbv1l4/sVkz+7+z+3tn6x8L78MT94KL60WwAbPDN2J/wXCzxgBz4nxLnMj34x5HubC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/bQPkSYpCM99TPy6UQJXDgsX2xpbxEnvcgdZzXb+ytdvLDXBbiDKju9otrO4crsuu77/o9/ThK8Tbta3Dnc3ZVHST65kB6WxurzK2Nzuz4o2xgNBP6J0pEOn/JIsr4otCKVPS06L0tgVkK3MUZfCzZwQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAh+BvwPiJty8YOgDgQAAAAASUVORK5CYII="> </div>
<div class="discription">
<h3>Title</h3>
<br>
<span>Sample text is here</span> </div>
</div>
css
#quality {
display: table;
margin-right: 10px;
padding: 20px;
}
#security {
padding-bottom: 10px;
display:table-cell;
}
.discription{
display:table-cell;
vertical-align:top;
padding:0 20px;
}

try this way
#quality {
margin-right: 10px;
padding: 20px;
}
#quality img{float:left; width:60px;}
#security {
padding-bottom: 10px;
}
#quality .contetn{width:calc(100% - 65px);float:right;}
#quality .contetn h3{margin-top:0;}
<div id="quality">
<div id="security">
<img src="img/security.png">
<div class="contetn">
<h3>Title</h3>
<span>Sample text is here</span>
</div>
</div>
</div>

You can do like this
#quality {
float: left;
padding: 20px;
}
#security {
padding-bottom: 10px;
float:left;
margin-right: 10px;
}
#text{
float:left;
}
<div id="quality">
<div id="security">
<img src="img/security.png">
</div>
<div id="text">
<span>Sample text is here</span>
<h3>Title</h3>
</div>
</div>

Related

How to clear the bottom of a float if text is below it

I am making a web that's like a facebook where there is a image on the left and text on the right but if the text reach the bottom of the image it goes to the bottom of image. Its hard to explain so I will attached a screenshot
.comment {
width: 100%;
}
.comment img {
height: 40px;
width: 40px;
border-radius: 20px;
margin-right: 10px;
float: left;
}
.comment img:after {
content: "";
}
strong {
color: #365899;
font-weight: bold;
}
<div id="View_post-1" class="row">
<div>
<div class="comment">
<img src="../Image/Mark Anthony Fernandez.jpg">
<small>
<strong style="">Mark Anthony Fernandez</strong>
</small>
<br />
<div>
<span style="font-size:small;position:relative;word-wrap:break-word;">commentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcomment</span>
</div>
<br>
</div>
</div>
</div>
If I understand well you don't want the text to wrap around the image to the left.
You can use flexbox to achieve that and it will give you a responsive solution.
I have created a codepen for your case: https://codepen.io/frexos/pen/yPjqYm
<div id="View_post-1" class="row">
<div>
<div class="comment">
<img src="../Image/Mark Anthony Fernandez.jpg">
<div class="text">
<small>
<strong style="">Mark Anthony Fernandez</strong>
</small>
<br />
<div>
<span style="font-size:small;position:relative;word-wrap:break-word;">commentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcomment</span>
</div>
</div>
<br>
</div>
.comment {
width: 100%;
display: flex;
}
.comment img {
display: block;
height: 40px;
width: 40px;
border-radius: 20px;
margin-right: 10px;
float: left;
}
.comment img:after {
content: "";
}
strong {
color: #365899;
font-weight: bold;
}
.text {
min-width: 10%;
word-wrap: break-word;
}
It looks you are using bootstrap to set your layout, you can use media object for this, check updated snippet below... for detail reference click here
.comment{
width:100%;
}
.comment img{
border-radius: 50px;
}
.comment img:after{
content:"";
}
strong{
color:#365899;
font-weight:bold;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div id="View_post-1" class="row">
<div>
<div class="comment">
<div class="media">
<div class="media-left">
<img class="media-object" src="https://dummyimage.com/50x50/cccccc/ff0000.png&text=Sample-Text">
</div>
<div class="media-body"><small>
<strong style="">Mark Anthony Fernandez</strong>
</small>
<br />
<div>
<span style="font-size:small;position:relative;word-wrap:break-word;">commentcommentcommentcom mentcommentcommentcommentcommen tcommentcommentcommentcommentcommentc ommentcommentcommentcom mentcommentco mmentcommentcomme ntcommentcommentcommentcomme ntcomm entcommentcommentcomme ntcommentcommentcommentcommentcommen tcommentcommentcommentcommentcommentcommentcommentc ommentcommentcomm entcomment</span>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
If you always know the width of the image you can just add a padding left to your div containing the text.
.comment > div{ padding-left: 50px;}
.comment {
width: 100%;
}
.comment img {
height: 40px;
width: 40px;
border-radius: 20px;
margin-right: 10px;
float: left;
}
.comment img:after {
content: "";
}
strong {
color: #365899;
font-weight: bold;
}
.comment > div{ padding-left: 50px;}
<div id="View_post-1" class="row">
<div>
<div class="comment">
<img src="../Image/Mark Anthony Fernandez.jpg">
<div>
<small>
<strong style="">Mark Anthony Fernandez</strong>
</small>
<br />
<div>
<span style="font-size:small;position:relative;word-wrap:break-word;">commentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcomment</span>
</div>
</div>
<br>
</div>
</div>
</div>
Try this:
.comment div{
display: flex;
word-break: break-all;
}
Please try this code:
.comment {
display: inline-block;
width: 100%;
}
.comment .image {
float: left;
width: 80px;
}
.comment img {
height: 40px;
width: 40px;
border-radius: 20px;
margin-right: 10px;
float: left;
}
.content {
float: left;
width: -webkit-calc(100% - 80px);
width: -moz-calc(100% - 80px);
width: -ms-calc(100% - 80px);
width: calc(100% - 80px);
}
.comment img:after {
content: "";
}
strong {
color: #365899;
font-weight: bold;
}
<div id="View_post-1" class="">
<div>
<div class="comment">
<div class="image">
<img src="../Image/Mark Anthony Fernandez.jpg">
</div>
<div class="content">
<small>
<strong style="">Mark Anthony Fernandez</strong>
</small>
<br />
<div>
<span style="font-size:small;position:relative;word-wrap:break-word;">commentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcommentcomment</span>
</div>
</div>
</div>
</div>
</div>

how to wrap div elements boxes with responsive

How to wrap div boxes into main div along with images with responsive.?
Am trying to achieve below layout.
When i use float:left the boxes are aligned perfect where as without it if i use display inline block the boxes are not aligned as shown below.
My jfiddle
.mywrapper {
margin: 0 auto;
min-width: 320px;
max-width: 905px;
background: yellow;
}
.firstblock {
margin-top: 60px;
margin-bottom: 60px;
background: red;
//background: #2b2b2b;
padding:30px;
width:auto;
height:auto;
}
.mainimage{
width: 190px;
height: 125px;
margin-left:2%;
float:left;
padding-right:30px;
}
.smallbox{
float: left;
width: 190px;
height: 110px;
background-color: green;
margin-right:10px;
}
.secondblock {
margin-bottom: 30px;
height: 215px;
background: aqua;
padding:30px;
}
<div class="mywrapper" id="myid">
Hello
<div class="firstblock">
<div >
<img class="mainimage" src="mainimg.JPG" border="0" />
</div>
<div>
<h2 class="title"><span>MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT</span></h2>
<div class="smallbox"><img class="pcspecimg" src="box1.JPG" alt="box1.JPG" border="0" /><span>box1</span><div>MY TEXT</div></div>
<div class="smallbox"><img class="pcspecimg" src="box2.JPG" alt="box2.JPG" border="0" /><span>box2</span><div>MY TEXT MY TEXT</div></div>
<div class="smallbox"><img class="pcspecimg" src="box3.JPG" alt="box3.JPG" border="0" /><span>box3</span><div>MY TEXT MY TEXT</div></div>
</div>
</div>
<div class="secondblock">
secondblock
</div>
</div>
I think you would like this
.mywrapper {
margin: 0 auto;
min-width: 320px;
max-width: 905px;
background: yellow;
}
.firstblock {
margin-top: 60px;
margin-bottom: 60px;
background: red;
//background: #2b2b2b;
padding:30px;
width:auto;
height:auto;
}
.left-div{
float:left;
width: 27%;
height: 125px;
margin-right:2%;
border: 1px solid;
}
.right-div{
float:right;
width:70%;
}
h2{
margin-top:0;
}
.clear{
clear:both;
}
img{
height:auto;
width:auto;
max-width:100%;
max-height:100%;
}
.pcspecimg {
border: 1px solid #fff;
float: left;
height: 40px;
margin-right: 3%;
width: 27%;
}
.small-wrap {
margin-bottom: 5px;
}
.smallbox {
background-color: green;
float: left;
height: 110px;
margin-right: 1.5%;
width: 32.3%;
padding:5px;
box-sizing: border-box;
}
.smallbox:last-child{
margin-right:0;
}
.secondblock {
margin-bottom: 30px;
height: 215px;
background: aqua;
padding:30px;
}
<div class="mywrapper" id="myid">
Hello
<div class="firstblock">
<div class="left-div">
<img class="mainimage" src="mainimg.JPG" border="0" />
</div>
<div class="right-div">
<h2 class="title">
<span>MY TEXT MY TEXT</span>
</h2>
<div class="smallbox">
<div class="small-wrap">
<div class="pcspecimg">
<img src="box1.JPG" alt="box1" border="0" />
</div>
<span>box1</span>
<div class="clear"></div>
</div>
<div>MY TEXT</div>
</div>
<div class="smallbox">
<div class="small-wrap">
<div class="pcspecimg">
<img src="box1.JPG" alt="box1" border="0" />
</div>
<span>box1</span>
<div class="clear"></div>
</div>
<div>MY TEXT</div>
</div>
<div class="smallbox">
<div class="small-wrap">
<div class="pcspecimg">
<img src="box1.JPG" alt="box1" border="0" />
</div>
<span>box1</span>
<div class="clear"></div>
</div>
<div>MY TEXT</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="secondblock">
secondblock
</div>
</div>
.mywrapper {
margin: 0 auto;
min-width: 320px;
max-width: 905px;
background: yellow;
}
.firstblock {
display: flex;
flex-direction: row;
margin-top: 60px;
margin-bottom: 60px;
background: red;
//background: #2b2b2b;
padding:30px;
width:auto;
height:auto;
}
.mainimage{
width: 190px;
height: 125px;
margin-left:2%;
float:left;
padding-right:30px;
}
.smallbox{
float: left;
width: 190px;
height: 110px;
background-color: green;
margin-right:10px;
}
.secondblock {
margin-bottom: 30px;
height: 215px;
background: aqua;
padding:30px;
}
<div class="mywrapper" id="myid">
Hello
<div class="firstblock">
<div>
<img class="mainimage" src="mainimg.JPG" border="0" />
</div>
<div>
<h2 class="title"><span>MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT MY TEXT</span></h2>
<div class="smallbox"><img class="pcspecimg" src="box1.JPG" alt="box1.JPG" border="0" /> <span>box1</span><div>MY TEXT</div>
</div>
<div class="smallbox"><img class="pcspecimg" src="box2.JPG" alt="box2.JPG" border="0" /> <span>box2</span><div>MY TEXT MY TEXT</div>
</div>
<div class="smallbox"><img class="pcspecimg" src="box3.JPG" alt="box3.JPG" border="0" /> <span>box3</span><div>MY TEXT MY TEXT</div>
</div>
</div>
</div>
<div class="secondblock">
secondblock
</div>
</div>
Is it you want?
Can You explain detail?

facing floating left and right issues

I need 2 divs inside a big one:
the first will float left and second will float right
i gave the 1st div width of 75% and the 2nd 25%, it seems that the 2nd div is not finding its right place so it keeps coming under the left div on the right side
this is my code:
<div class="centerDiv2">
<span class="title2">LATEST BULLETIN</span>
<hr>
<div class="divLeft">
<img src="images/5891.jpg"/>
<span class="title">JUL 19</span>
<p class ="prog">"I Mathew</p>
</div>
<div class="divLeft">
<img src="images/42St.jpg"/>
<span class="title">JUL 19</span>
<p class ="prog">"I Mathew</p>
</div>
<div class="divRight">
<span class="title">RECENTLY</span>
<hr>
</div>
</div>
CSS:
.divLeft {
width:70%;
margin: 30 0;
}
.title2 {
font-size: 20px;
font-weight:bolder;
font-family: courier;
float: left;
width: 100%;
}
.centerDiv2 {
width: 1000px;
margin: 30 auto;
}
.divRight {
width:25%;
height:400px;
background-color: lightgray;
float:right;
margin: 30 0;
}
HTML:
<div class="centerDiv2">
<span class="title2">LATEST BULLETIN</span>
<hr>
<div class="leftDiv">
<div class="divLeft">
<img src="images/5891.jpg"/>
<span class="title">JUL 19</span>
<p class ="prog">"I Mathew</p>
</div>
<div class="divLeft">
<img src="images/42St.jpg"/>
<span class="title">JUL 19</span>
<p class ="prog">"I Mathew</p>
</div>
</div>
<div class="divRight">
<span class="title">RECENTLY</span>
<hr>
</div>
</div>
CSS:
.title2 {
font-size: 20px;
font-weight:bolder;
font-family: courier;
width: 100%;
}
.leftDiv{
width: 70%; display: inline-block;
}
.divRight {
display: inline-block; vertical-align: top; height: 400px; width: 25%;background-color: lightgray;
}
hi dude the issue is with width 75% and 25% using with the margin because you are giving margin though you have already 100% of you canvas means(body)
.wrapper{
margin: 30px 0;
}
.divLeft {
width:70%;
background-color:red;
}
.title2 {
font-size: 20px;
font-weight:bolder;
font-family: courier;
float: left;
width: 100%;
}
.centerDiv2 {
width: 1000px;
margin: 30px auto;
}
.divRight {
width:25%;
height:400px;
background-color: lightgray;
float:right;
margin: 30px 0;
background-color:black;
}
<div class="centerDiv2">
<span class="title2">LATEST BULLETIN</span>
<hr>
<div class="wrapper">
<div class="divLeft">
<img src="images/5891.jpg"/>
<span class="title">JUL 19</span>
<p class ="prog">"I Mathew</p>
</div>
<div class="divLeft">
<img src="images/42St.jpg"/>
<span class="title">JUL 19</span>
<p class ="prog">"I Mathew</p>
</div>
</div>
<div class="divRight">
<span class="title">RECENTLY</span>
<hr>
</div>
</div>

Centering images with text as menu

Im trying to put together some images together with an text under the images which will work as an menu, which should be centered horizontal under an header. The website is supposed to work as an responsive website. The HTML and CSS code is currently looking like this:
Edited
I want 5 images, each one of them shall have a text under them. And I want the my images together with the text to be centered.
HTML
<nav>
<div id="content">
<img src="ikoner/icon_90_2.png"/>
<div class="text">Utvecklingen sedan 90-talet</div>
</div>
<div id="content">
<img src="ikoner/icon_html5.png"/>
<div class="text">HTML5</div>
</div>
<div id="content">
<img src="ikoner/icon_html5video.png"/>
<div class="text">HTML5 Video</div>
</div>
<div id="content">
>img src="ikoner/icon_responsive.png"/>
<div class="text">Responsive Webdesign</div>
</div>
<div id="content">
<img src="ikoner/icon_heart.png"/>
<div class="text">Emotional Design</div>
</div>
</nav>
CSS
#content {
position: relative;
width: 15%;
display: inline-block;
text-align: center;
margin-left: auto;
margin-right: auto;
}
#content img {
padding-top: 370px;
width: 100px;
}
.text {
font-size: 12px;
font-family: 'ciclethin';
text-decoration: none;
}
You're not aligning your "Nav" div anywhere.
So, I've changed the id="content" to classes, because IDs should be unique to the page.
Set nav element to text-align:center. Here's a fiddle, and the relevant code:
http://jsfiddle.net/cw16tkdn/2/
<nav>
<div class="content">
<img src="http://placekitten.com/g/200/200" />
<div class="text">Utvecklingen sedan 90-talet
</div>
</div>
<div class="content">
<img src="http://placekitten.com/g/200/200" />
<div class="text">HTML5
</div>
</div>
<div class="content">
<img src="http://placekitten.com/g/200/200" />
<div class="text">HTML5 Video
</div>
</div>
<div class="content">
<img src="http://placekitten.com/g/200/200" />
<div class="text">Responsive Webdesign
</div>
</div>
<div class="content">
<img src="http://placekitten.com/g/200/200" />
<div class="text">Emotional Design
</div>
</div>
</nav>
and CSS:
nav {
text-align:center;
}
.content {
display: inline-block;
text-align: center;
}
.content img {
width: 100px;
}
.text {
font-size: 12px;
font-family:'ciclethin';
text-decoration: none;
}
maybe you want this: (i have changed id=content with class=content in html code!)
.content {
position: relative;
width: 100px;
display: inline-block;
height: 520px;
text-align: center;
vertical-align:bottom;
}
.content img {
padding-top: 370px;
width: 100px;
display:block;
margin: auto;
}
.text a {
font-size: 12px;
font-family: 'ciclethin';
text-decoration: none;
}
.text {
height: 3em;
}

Div circle images issue

I'm trying to make these 4 images to be circle but I guess I'll just use images later but anyway. I'm trying to put a title under the image (bottom-middle) but instead its at the top. This is what happened.
.services img{
border-radius: 50%;
padding-left: 10px;
float: left;
display: block;
}
<section class="services">
<h1 style="text-align:center; font-size:38px;">Services we offer</h1>
<div class="circle">
<img src="http://placehold.it/290x250">
<h3>Title</h3>
</div>
<div class="circle">
<img src="http://placehold.it/290x250">
<h3>Title</h3>
</div>
<div class="circle">
<img src="http://placehold.it/290x250">
<h3>Title</h3>
</div>
<div class="circle">
<img src="http://placehold.it/290x250">
<h3>Title</h3>
</div>
</section>
So it'd look like my design.
You need also to set the .circle class to float left:
.circle
{
width: 25%;
float: left;
}
http://jsfiddle.net/yh988n5e/
.circle{
text-align: center;
display: inline-block;
}
.services img{
border-radius: 50%;
padding-left: 10px;
display: block;
}
http://jsfiddle.net/mx7xknzr/1/