CSS Tooltips line break - html

I've text to show inside a tooltip on hover of an icon.
The tooltips width need to be:
max-width:300px
if the text fit in one line and less than 300px, adjust to text width
if the text need many lines, the tooltip width need to be 300px
How can I define the .tooltip .content-tooltip to work like describe before ?
I've tried using white-space: nowrap; and some word-break ...
.tooltip {
position: relative;
margin-right: 5px;
display: block;
text-align: center;
width: 75px;
padding: 5px;
border: 1px dotted #000;
margin: 70px auto;
}
.tooltip .content-tooltip {
position: absolute;
bottom: calc(100% + 13px);
background: #000;
color: #fff;
display: block;
left: 50%;
transform: translateX(-50%);
padding: 5px 10px 6px;
display: none;
text-align: left;
max-width: 300px;
width: auto;
}
.tooltip:hover .content-tooltip {
display: block;
}
<h1>Example</h1>
<span class="tooltip">
short text
<span class="content-tooltip">
Lorem
</span>
</span>
<span class="tooltip">
long text
<span class="content-tooltip">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla nunc massa, eleifend a feugiat ac, varius eu eros.
Praesent at vulputate risus. Pellentesque dictum pulvinar lectus.
</span>
</span>
<hr><hr>
<h1>What I expect</h1>
<span class="tooltip">
short text
<span class="content-tooltip">
Lorem
</span>
</span>
<span class="tooltip">
long text
<span class="content-tooltip" style="width: 300px">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla nunc massa, eleifend a feugiat ac, varius eu eros.
Praesent at vulputate risus. Pellentesque dictum pulvinar lectus.
</span>
</span>

I fixed the issue by taking out the tooltip from the text content element, and wrapped the tooltip and text content width another div which will act container for both of them, so that tooltip won't take up the width as per the text content instead it will take the width as specified.
This how you should do it:
body {
display: flex;
gap: 30px;
padding: 1rem;
}
.text {
padding: 10px;
}
.tooltip {
display: none;
position: absolute;
background: #000;
color: #fff;
max-width: 300px;
padding: 10px;
}
.text-contianer:hover > .tooltip {
display: inline-block;
}
<div class="text-contianer">
<div class="text">
Short
</div>
<span class="tooltip">
Lorem
</span>
</div>
<div class="text-contianer">
<div class="text">
Long
</div>
<span class="tooltip">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla nunc massa, eleifend a feugiat ac, varius eu eros.
Praesent at vulputate risus. Pellentesque dictum pulvinar lectus.
</span>
</div>

The desired solution can be attained if you set a height value to the tooltip.
I see that you've used max-width, which is the desirable here but one thing which I guess you missed is that the default value of height for tooltip is auto, due to which if you reduce the width of the tooltip, the component will adjust to increase the height. One simple solution as I mentioned is to set a height value, and overflow to hidden
Updated CSS Code:
.tooltip {
position: relative;
margin-right: 5px;
display: block;
text-align: center;
width: 75px;
padding: 5px;
border: 1px dotted #000;
margin: 70px auto;
}
.tooltip .content-tooltip {
position: absolute;
bottom: calc(100% + 13px);
background: #000;
color: #fff;
display: block;
left: 50%;
transform: translateX(-50%);
padding: 5px 10px 6px;
display: none;
text-align: left;
max-width: 320px;
height: 15px; //height value set to avoid component auto adjust
overflow: hidden; //overflow hidden
}
.tooltip:hover .content-tooltip {
display: block;
}

Found myself a solution :
.tooltip {
position: relative;
margin-right: 5px;
display: block;
text-align: center;
width: 75px;
padding: 5px;
border: 1px dotted #000;
margin: 70px auto;
}
.tooltip .sizing-tooltip {
position: absolute;
bottom: calc(100% + 13px);
left: 50%;
transform: translateX(-50%);
display: none;
width: 300px;
}
.tooltip .content-tooltip {
background: #000;
color: #fff;
padding: 5px 10px 6px;
display: block;
text-align: left;
max-width: 300px;
width: auto;
margin: 0 auto;
}
.tooltip:hover .sizing-tooltip {
display: flex;
}
<h1>Example</h1>
<span class="tooltip">
short text
<span class="sizing-tooltip">
<span class="content-tooltip">
Lorem
</span>
</span>
</span>
<span class="tooltip">
long text
<span class="sizing-tooltip">
<span class="content-tooltip">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nulla nunc massa, eleifend a feugiat ac, varius eu eros.
Praesent at vulputate risus. Pellentesque dictum pulvinar lectus.
</span>
</span>
</span>

Related

How do I wrap text around image with a colored text box?

image of what I am trying to do
I am trying to have an image aligned left with a colored text box that overlaps (positioned off-center) to the image. I can get that by creating a div class="mycontainer" with div class= my text-box" and css (see below), but I can't seem to figure out how to make text wrap around the colored text box. It wraps around the image, but keeps pushing the text box down.
.mycontainer {
position: relative;
font-family: Arial;
width: 100%;
}
.mytext-block {
position:absolute;
margin-top: 50px;
margin-left: 150px;
background-color:turquoise;
color: black;
padding-left: 10px;
padding-right: 10px;
}
Hi Rachel here is a way to wrap text around an image which is inset into a colored box.
.mycontainer {
position: relative;
font-family: Arial;
width: 100%;
margin: auto;
max-width: 670px;
}
.mytext-block {
width: 300px;
height: 400px;
float: left;
vertical-align: middle;
background-color: turquoise;
color: black;
}
#image {
width: 250px;
height: 100px;
position: relative;
float: left;
left: -190px;
shape-outside: content-box;
margin: 140px -170px 0 0;
}
#text {
font-size: 140%;
padding: 30px;
}
<div class="mycontainer">
<div class="mytext-block"></div>
<img id="image" src="https://lorempixel.com/300/100/">
<div id="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellen tesque placerat dolor sed dolor euismod hendrerit. Integer eget elit nibh. Vestibulum posuere. Sed elementum bibendum magna, nec tempus augue egestas quis. Pellentesque lacus justo, vehicula vitae nisl sed, semper euismod dui.
</div>
</div>
<!-- Click the "Run code snippet" below to see it. Hope this helps. -->

Make a floated image appear beside some text inside a div

I have a div with some text and an image that should appear to the right of the text.
The problem is that the image is appearing on the right, but it is not beside the text. I have used float:right and clear option but it still doesn't work properly.
My code is:
.box {
width: 600px;
height: 1000px;
left: calc( 45% - 200px);
top: 20%;
position: absolute;
border-radius: 5px;
border: 2px solid rgba(255, 255, 255, 0.3);
padding: 0px;
text-align: center;
box-sizing: border-box;
display: flex;
}
.content {
border: 4px solid red;
width: 600px;
word-wrap: break-word;
}
.img {
margin-left: 15px;
float: right;
display: inline-block;
clear: both;
}
<div class="box">
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultrices, urna ut eleifend blandit, orci nisi vehicula nisi, sit amet commodo nisl ligula ac nunc.</p>
<img src="http://placehold.it/150x250/000000/ffffff" class="img">
</div>
</div>
THIS is what I want to do.
Just put the floated element first:
<div class="box">
<div class="content">
<img src="http://placehold.it/150x250/000000/ffffff" class="img">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultrices, urna ut eleifend blandit, orci nisi vehicula nisi, sit amet commodo nisl ligula ac nunc.</p>
</div>
</div>
It'll float off to the left and then your text will fill the space on the right.
By putting the text first, the image doesn't displayed until after the text element ends, so the image will be floated under the text. (Just like if you didn't float it, it would appear under the text).
Expand for a working snippet to see it in action:
.box {
width: 600px;
height: 1000px;
left: calc( 45% - 200px );
top:20%;
position: absolute;
border-radius: 5px;
border: 2px solid rgba(255, 255, 255, 0.3);
padding: 0px;
text-align: center;
box-sizing: border-box;
display: flex;
}
.content{
border: 4px solid red;
width: 600px;
word-wrap:break-word;
}
.img{
margin-left: 15px;
float: right;
display:inline-block;
clear:both;
}
<div class="box">
<div class="content">
<img src="http://placehold.it/150x250/000000/ffffff" class="img">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultrices, urna ut eleifend blandit, orci nisi vehicula nisi, sit amet commodo nisl ligula ac nunc.</p>
</div>
</div>
To achieve the expected result, the <img> should go before <p> tag in your HTML. Here is an example:
.box {
width: 600px;
height: 1000px;
left: calc( 45% - 200px);
top: 20%;
position: absolute;
border-radius: 5px;
border: 2px solid rgba(255, 255, 255, 0.3);
padding: 0px;
text-align: center;
box-sizing: border-box;
display: flex;
}
.content {
border: 4px solid red;
width: 600px;
word-wrap: break-word;
}
.img {
margin-left: 15px;
float: right;
display: inline-block;
clear: both;
}
<div class="box">
<div class="content">
<img src="http://placehold.it/150x250/000000/ffffff" class="img">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultrices, urna ut eleifend blandit, orci nisi vehicula nisi, sit amet commodo nisl ligula ac nunc.</p>
</div>
</div>
Either put the image before the p tag, or put it inside the p tag (see my snippet).
By the way: When you apply float to an element, inline-block will have no effect at all, and also the clearing does nothing in this particular case.
.box {
width: 600px;
height: 1000px;
left: calc( 45% - 200px);
top: 20%;
position: absolute;
border-radius: 5px;
border: 2px solid rgba(255, 255, 255, 0.3);
padding: 0px;
text-align: center;
box-sizing: border-box;
display: flex;
}
.content {
border: 4px solid red;
width: 600px;
text-align: left;
}
.img {
margin-left: 15px;
float: right;
}
<div class="box">
<div class="content">
<p><img src="http://placehold.it/150x250/000000/ffffff" class="img">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultrices, urna ut eleifend blandit, orci nisi vehicula nisi, sit amet commodo nisl ligula ac nunc.</p>
</div>
</div>

How do I make a stack of divs that stick to the bottom of their parent div?

I am making a simple messaging app UI. I am trying to make the messages anchor to the bottom of the screen like most modern messaging applications. So far, here is the bare bones of my messaging UI:
HTML
<div class="main-wrapper">
<div class="contact-list">
contacts here
</div>
<div class="conversation-area">
<div class="msg msg-them">this is Alison</div>
<div class="msg msg-me">this is me!</div>
<div class="msg msg-them">you are so cool! :)</div>
<div class="msg msg-them">seriously.</div>
</div>
</div>
SASS
body, html {
height: 100%;
}
.main-wrapper {
height: 100%;
margin: 0px auto;
overflow: hidden;
.contact-list{
float: left;
width: 200px;
height: 100%;
background-color: #aaa;
border-right: 2px solid #777;
}
.conversation-area{
overflow: hidden;
height: 100%;
background-color: #ccc;
.msg{
vertical-align: bottom;
border: 1px solid black;
&-them{
background-color: blue;
float: left;
max-width: 250px;
display: inline;
clear: both;
}
&-me{
background-color: red;
float: right;
max-width: 250px;
display: inline;
clear: both;
}
}
}
}
Whenever a new message comes in, I'll insert it as the last child of the .conversation-area div. I have the messages stacking just like I want them. I just need to make them stick to the bottom of the .conversation-area div.
I've tried messing with position attributes of both the parent and child divs, as well as tried to get vertical-align to work, but so far I haven't gotten it functioning.
How can I make my messaging app look exactly the same EXCEPT the messages stick to the bottom rather than the top?
Here's the jsFiddle: https://jsfiddle.net/63vufn7u/1/
You can achieve this with display:table-cell; and vertical-align:bottom;
I have made some changes to your code but im sure you can adapt now its working:
.main-wrapper {
width: 100%;
height: 200px;
font-family:sans-serif;
}
.contact-list {
width:25%;
display: table-cell;
height: 200px;
background: #555;
color: #fff;
text-align: center;
float: left;
}
#conversation-area {
height: 200px;
width: 300px;
background: steelblue;
display: table-cell;
vertical-align: bottom;
}
.msg {
display: block;
margin: 15px 10px;
}
.msg p {
border-radius:5px 5px 5px 5px;
background: #fff;
display: inline;
padding: 5px 10px;
box-shadow: 3px 3px 5px 0px rgba(0,0,0,0.75);
}
.msg-me {
text-align: left;
}
.msg-me p {
border-radius:15px 15px 15px 0px;
}
.msg-them {
text-align: right;
}
.msg-them p {
border-radius:15px 15px 0px 15px;
}
<div class="main-wrapper">
<div class="contact-list">
Contacts
</div>
<div id="conversation-area">
<div class="msg msg-them"><p>this is Alison</p></div>
<div class="msg msg-me"><p>this is me!</p></div>
<div class="msg msg-them"><p>you are so cool! :)</p></div>
<div class="msg msg-them"><p>seriously.</p></div>
</div>
</div>
Your friendly neighborhood Flexbox solution:
On the container, you could also use the justify-content property to align it's contents to the bottom:
.conversation-area {
display:flex;
flex-direction:column;
justify-content:flex-end;
}
Learn more about flexbox here: http://www.flexboxin5.com
The easiest way I've found is to use flex-direction: column-reverse;.
The drawback to flex-direction: column; is that it starts you at the top and you have to scroll down for older texts. And that's not how chat app interfaces tend to work.
column-reverse makes the texts stick to the bottom. The tradeoff is you have to insert your messages in ascending time stamp order instead of reversed like you normally would, because flex-box does the reversing in css. Same with any animations. So new text bubble animation would be applied to the :first child rather than the :last child.
Here's an example without animations: https://jsfiddle.net/ut1Lybsj/1/
<style>
.container {
height: 200px;
width: 200px;
overflow-y: scroll;
display: flex;
flex-direction: column-reverse;
border: 1px solid black;
}
.container div {
margin-top: 20px;
}
</style>
<div class="container">
<div style="background:red;">First Item<br/> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada semper purus, non rutrum nulla mollis id. Nunc faucibus hendrerit nunc, eu rhoncus nisi congue non. </div>
<div style="background: skyblue;">Second Item<br/> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada semper purus, non rutrum nulla mollis id. Nunc faucibus hendrerit nunc, eu rhoncus nisi congue non. </div>
<div style="background: green;">Third Item<br/> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada semper purus, non rutrum nulla mollis id. Nunc faucibus hendrerit nunc, eu rhoncus nisi congue non. </div>
</div>

Z-index for image and div [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am looking for a way to allow an image inside of a div to stay overflow:visible and to allow the border of the parent div to overlap the image. Right now I have the image right where I want it using negative margins, but the images is covering the parent div's border.
I tried using z-index for the image and the div but that did now work.
This is the effect that I am trying to achieve.
http://imgur.com/a/yt8eU
This where I currently am.
http://imgur.com/a/sgYjI
https://jsfiddle.net/zgwywq0v/
random html <p>
Position the image absolutely or relatively and set it z-index: -1.
div.keynote {
border: 3px solid #F68B1F;
position: relative;
}
div.keynote img {
position: absolute;
left: -20px;
top: -20px;
z-index: -1;
}
https://jsfiddle.net/zgwywq0v/3/
The main trick here is to use the pseudo element ::before for the border, and to align them left/right I gave their parent keynote display: flex
Note, an obvious way would be using z-index, though if one can do it without, do it without
div.keynote {
position: relative;
display: flex;
}
div.keynote::before {
content: '';
position: absolute;
border: 3px solid #F68B1F;
left: 20px;
top: 20px;
right: 20px;
bottom: 20px;
}
div.keynote .speaker-info {
position: relative;
padding: 30px 30px 30px 10px;
box-sizing: border-box;
}
<div class="keynote keynote-border">
<div>
<img src="http://placehold.it/240x320">
</div>
<div class="speaker-info">
<p class="name">PASTOR
<br><strong>PATRICK</strong>WINFIELD</p>
<p class="session">PREPARING FOR TOMORROW</p>
<p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut molestie rutrum ipsum, luctus interdum metus egestas non. Aliquam at mi sollicitudin leo blandit ornare. Suspendisse laoreet ultrices ante. Nunc a velit elementum, pretium erat ut, vulputate
ante. Maecenas ac magna augue. Donec ac mauris lectus.</p>
</div>
</div>
Updated based on comment
If you can't/don't want to use flex, here is a fallback
div.keynote {
position: relative;
overflow: auto; /* clear float and grow with its content */
}
div.keynote::before {
content: '';
position: absolute;
border: 3px solid #F68B1F;
left: 20px;
top: 20px;
right: 20px;
bottom: 20px;
}
div.keynote div:first-child {
float: left;
width: 240px;
}
div.keynote .speaker-info {
position: relative;
margin-left: 240px; /* left div width */
padding: 30px 30px 30px 10px;
box-sizing: border-box;
}
<div class="keynote keynote-border">
<div>
<img src="http://placehold.it/240x320">
</div>
<div class="speaker-info">
<p class="name">PASTOR
<br><strong>PATRICK</strong>WINFIELD</p>
<p class="session">PREPARING FOR TOMORROW</p>
<p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut molestie rutrum ipsum, luctus interdum metus egestas non. Aliquam at mi sollicitudin leo blandit ornare. Suspendisse laoreet ultrices ante. Nunc a velit elementum, pretium erat ut, vulputate
ante. Maecenas ac magna augue. Donec ac mauris lectus.</p>
</div>
</div>
Take the image out of the div and place bordered div and img inside a parent with position: relative; then you can change the position and z-index of bordered div and img to get your result.
This looks like the perfect opportunity to deploy an ::after pseudo-element - this will enable you to make the orange border exactly the dimensions you need it to be and position it exactly where you want it to be, completely independently of all the other elements.
.profile-card {
margin: 100px 0 0 100px;
width: 600px;
height: 300px;
font-family: arial, helvetica, sans-serif;
}
.profile-card::after {
content: '';
position: absolute;
top: 70px;
left: 70px;
z-index: 0;
display: block;
width: 600px;
height: 220px;
border: 3px solid rgb(255,165,0);
}
.profile-card h2 {
font-weight: 300;
}
.profile-card h2 b {
font-weight: 900;
}
.profile-card p,
.profile-card a.more {
font-size: 11px;
}
.profile-card h2,
.profile-card h2 ~ strong,
.profile-card a.more {
text-transform: uppercase;
}
.profile-card img {
display: block;
float: right;
width: 280px;
height: 280px;
background-color: rgb(191,191,191);
border: 1px solid rgb(0,0,0);
transform: translateY(-108px);
}
.profile-card a.more {
display: inline-block;
position: relative;
z-index: 6;
margin-left: 90px;
padding: 12px;
color: rgb(255,255,255);
background-color: rgb(255,165,0);
text-decoration: none;
}
<div class="profile-card">
<h2><b>Profile</b> Name</h2>
<img src="/profile-name.png" alt="Profile Photo" />
<strong>Profile Tagline Here</strong>
<p>Paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here, paragraph here.</p>
<a class="more" href="/more.html">Read More</a>
</div>

Trying to use a div as a separator for different sections

Essentially I am trying to use the <Div> tag to create a bottom border to separate different content on the page but when I scroll to the bottom and insert the div there to separate them, it will ignore the other tags I have put and attached itself to the previous div separator.
How can I fix this? I tried using a HR tag but it did the same.
This is my code:
div {
margin: 0;
padding: 0;
}
#wrapper {
width: 100%;
margin: 0 auto;
}
#leftcolumn,
#rightcolumn {
border: none;
float: left;
min-height: 450px;
color: white;
}
#leftcolumn {
width: 50%;
}
.container {
margin-left: 10%;
width: 40%;
text-align: center;
}
#rightcolumn {
/* height: 100%;*/
width: 40%;
float: right;
background-color: #c9ccc9;
}
.border {
border-bottom: 40px solid #8dc43f;
}
p {
color: black;
}
.infotext {
color: #8dc43f;
margin-left: 30%;
font-family: 'ABeeZee', sans-serif;
font-size: 30px;
}
.infotexttitle {
color: #8dc43f;
margin-left: 25%;
font-family: 'ABeeZee', sans-serif;
font-size: 30px;
}
.infotexttitlepower {
color: #8dc43f;
margin-left: 36%;
font-family: 'ABeeZee', sans-serif;
font-size: 30px;
}
.infotexttitlecomm {
color: #8dc43f;
margin-left: 17%;
font-family: 'ABeeZee', sans-serif;
font-size: 30px;
}
.bluetags {
width: 264px;
padding: 0;
/* transform:rotate(180deg);*/
display: block;
/* border-collapse:collapse;*/
margin-left: 176px;
margin-top: 4px;
}
.greentags {
width: 264px;
padding: 0;
/* transform:rotate(180deg);*/
display: block;
/* border-collapse:collapse;*/
margin-left: 180px;
margin-top: -26px;
}
.orangetags {
width: 280px;
padding: 0;
/* transform:rotate(180deg);*/
display: block;
/* border-collapse:collapse;*/
margin-left: 175px;
margin-top: -15px;
}
.image {
position: relative;
width: 80%;
/* for IE 6 */
}
.titleimg {
margin-left: -60%;
margin-right: 10%;
}
imagetext {
position: absolute;
top: 200px;
left: 0;
width: 100%;
}
.bgimg {
background-size: cover;
width: 100%;
height: 60%;
border-collapse: collapse;
display: block;
margin: 0;
padding: 0;
}
#container {
height: 400px;
width: 400px;
position: relative;
}
#text {
z-index: 100;
position: absolute;
color: white;
font-size: 24px;
font-weight: bold;
left: 43%;
top: 25%;
font-family: 'ABeeZee', sans-serif;
}
#secondtext {
z-index: 100;
position: absolute;
color: white;
font-size: 24px;
font-weight: bold;
left: 37%;
top: 30%;
font-family: 'ABeeZee', sans-serif;
}
<div id="cssmenu">
<ul>
<img src="turtletag.png" class="titleimg">
<li><span>Home</span>
</li>
<li><span>Features</span>
</li>
<li><span>App</span>
</li>
<li><span>Products</span>
</li>
<li><span>Support</span>
</li>
</ul>
</div>
<img src="googlestore.png" style="position:absolute; top:210px;left:70px; width: 10%;">
<img src="appstore.png" style="position:absolute; top:320px; left:77px; width:10%;">
Order Tags
<img src="iPhone5_Mockup_Template_Free_by_Ray.png" class="bgimg">
<p id="text">Turtle Tags</p>
<p id="secondtext">Always connected to the nest</p>
<div class="border"></div>
<div id="leftcolumn">
<div class="mainbody">
<img src="bluetags.png" class="bluetags hvr-float">
</div>
<div class="mainbody">
<img src="greentags.png" class="greentags hvr-float">
</div>
<div class="mainbody">
<img src="orangetag.png" class="orangetags hvr-float">
</div>
</div>
<a name="features"></a>
<div id="rightcolumn">
<h2 class="infotext">Features</h2>
<hr class="newstyle">
<img src="battery.png" style="margin-left:40%; width:15%">
<p class="infotexttitle">Long battery life</p>
<p rows="4" columns="4" style="width:350px;margin-left:100px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur urna enim, aliquet non sagittis sit amet, euismod luctus risus. Aliquam venenatis arcu quam, id hendrerit dolor fermentum sed. Nullam congue molestie dolor quis egestas. Suspendisse
potenti.
</p>
<img src="speaker-xxl.png" style="margin-left:45%; width:10%; margin-top:30px;">
<p class="infotexttitle">Noise Notifications</p>
<p rows="4" columns="4" style="width:350px;margin-left:100px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur urna enim, aliquet non sagittis sit amet, euismod luctus risus. Aliquam venenatis arcu quam, id hendrerit dolor fermentum sed. Nullam congue molestie dolor quis egestas. Suspendisse potenti.
</p>
<img src="powericon.png" style="margin-left:45%; width:10%; margin-top:30px;">
<p class="infotexttitlepower">Always on</p>
<p rows="4" columns="4" style="width:350px;margin-left:100px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur urna enim, aliquet non sagittis sit amet, euismod luctus risus. Aliquam venenatis arcu quam, id hendrerit dolor fermentum sed. Nullam congue molestie dolor quis egestas. Suspendisse potenti.
</p>
<img src="twoway.png" style="margin-left:45%; width:10%; margin-top:30px;">
<p class="infotexttitlecomm">Two way communication</p>
<p rows="4" columns="4" style="width:350px; margin-left:100px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur urna enim, aliquet non sagittis sit amet, euismod luctus risus. Aliquam venenatis arcu quam, id hendrerit dolor fermentum sed. Nullam congue molestie dolor quis egestas. Suspendisse potenti.
</p>
</div>
I've tried changing the css and I can't find anything that would cause it, But a fresh pair of eyes may be able to find something I cannot.
The problem here comes from how you constructed your page. You have a left/right column that was built using floats. when you use float, it takes the content in the float out of the general flow of the page. Try to remove those floats and it should work as expected.
I removed your floats in the fiddle and the border started working right.
https://jsfiddle.net/ahmadabdul3/ghogvcsx/4/
here's a basic idea on how floats work: the top boxes don't overlap because there is no float, but the bottom 2 boxes you only see green because the red one is floated so the green one takes its space. to avoid this, add an explicit height to the floated div, but then you can't have dynamically expanding content. https://jsfiddle.net/ahmadabdul3/bL8qLa6j/2/
and here's a basic idea of how columns work: https://jsfiddle.net/ahmadabdul3/bL8qLa6j/5/