When I open the page in the half screen it appears like this
but when I open it full Screen it appears like this
I tried adding min and max-width but I can't figure out where is the problem
.Price {
font-size: 10pt;
}
.infoS {
background-color: #da9b48;
color: rgb(31, 22, 5);
padding: 3px;
width: 90%;
margin: 0 auto;
margin-top: 15px;
padding-left: 45px;
}
.Pinfo {
font-size: 7pt;
}
<table>
<td class="infoS">
<p class="Pinfo">
PIXMA G640
</p>
<img src="./images/PIXMA G640.png" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 150$
</p>
</td>
<td class="infoS">
<p class="Pinfo">
PIXMA TS7440
</p>
<img src="./images/PIXMA TS7440.png" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 250$
</p>
</td>
<td class="infoS">
<p class="Pinfo">
PIXMA G540
</p>
<img src="./images/PIXMA G540.png" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 170$
</p>
<td class="infoS">
<p class="Pinfo">
PIXMA G540
</p>
<img src="./images/PIXMA G540.png" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 120$
</p>
</td>
</tr>
</table>
**Your code is also missing a closing tr and a missing td tag.
For the solution, I would suggest you to use 'display: inline-flex' and justify-content: space-evenly for this case.
.Price {
font-size: 10pt;
}
.infoS {
background-color: #da9b48;
color: rgb(31, 22, 5);
padding: 3px;
width: 90%;
margin: 0 auto;
margin-top: 15px;
padding-left: 45px;
}
.Pinfo {
font-size: 7pt;
}
tr.row {
width: 100vw;
display: inline-flex;
justify-content: space-evenly;
}
<table>
<tr class="row">
<td class="infoS">
<p class="Pinfo">
PIXMA G640
</p>
<img src="https://i.picsum.photos/id/977/536/354.jpg?hmac=slVWYbVbxWnJGkpSJ9FX_iXkIBqJAupfNrNR1CWBoAQ" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 150$
</p>
</td>
<td class="infoS">
<p class="Pinfo">
PIXMA TS7440
</p>
<img src="https://i.picsum.photos/id/977/536/354.jpg?hmac=slVWYbVbxWnJGkpSJ9FX_iXkIBqJAupfNrNR1CWBoAQ" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 250$
</p>
</td>
<td class="infoS">
<p class="Pinfo">
PIXMA G540
</p>
<img src="https://i.picsum.photos/id/977/536/354.jpg?hmac=slVWYbVbxWnJGkpSJ9FX_iXkIBqJAupfNrNR1CWBoAQ" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 170$
</p>
</td>
<td class="infoS">
<p class="Pinfo">
PIXMA G540
</p>
<img src="https://i.picsum.photos/id/977/536/354.jpg?hmac=slVWYbVbxWnJGkpSJ9FX_iXkIBqJAupfNrNR1CWBoAQ" alt="Pixma photo printer" width="75" height="75">
<p class="Price">
Price : 120$
</p>
</td>
</tr>
</table>
Working Fiddle
I've been having an issue where the signature we've built works on nearly everything except IOS devices like Iphone and Ipad. on those devices the second cell is much thinner than it's supposed to be, and I can't tell if it's because the first cell is too big or if something else is causing this.
I figured standard table HTML would be fairly universal, and I don't have any fancy code going in here, so I expect it's some sort of odd interaction in how it's being translated by the mail app.
I've tried making the cells one pixel shorter, in case it's somehow not liking how it fits in the full 600 pixel width table. No dice.
Any idea what might be causing this? Thanks a ton for any help.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<table style="width: 600px; border-collapse: collapse; font-family: Arial;">
<tr style="width: 600px;">
<td colspan="2" style="width: 314px; border-bottom: 2px solid #1a206c; padding-top: 0px; padding-bottom: 8px; vertical-align: top; " >
<span style="font-size: 18pt; font-weight: bold; color: #1a206c;">
John Doe
<a href="https://en.wikipedia.org/wiki/ITIL" style="text-decoration: none;">
<img src="http://www.gosafe.com/signatures/personalcerts/itil.png" border="0" alt="Certification"/>
</a>
</span>
<br>
<span style="font-size: 11pt; font-weight: bold; color: #ff6400; line-height: 20px;">
Senior Operating Officer
</span>
</td>
<td colspan="2" style="width: 284px; border-bottom: 2px solid #1a206c; padding-top: 0px; padding-bottom: 8px; vertical-align: top;">
<span style="font-size: 9pt; color: #1a206c; font-family: Arial;">
<img src="https://www.gosafe.com/signatures/5-2021-images/tollfree.png" alt="Phone Number" vertical-align="center"/>
<strong style="line-height: 20px;"> 555.555.5555</strong>
<img src="https://www.gosafe.com/signatures/5-2021-images/mobile.png" border="0" alt="Mobile"/>
<strong style="line-height: 20px;"> 555.555.5555</strong>
</span>
<br style="font-size: 9pt;" />
<span style="font-size: 9pt; color: #1a206c; font-family: Arial; line-height: 20px; vertical-align: middle;">
<img src="https://www.gosafe.com/signatures/5-2021-images/email.png" border="0" alt="Email"/>
<strong style="line-height: 20px;"> John_Doe#exampleguy.com</strong>
</span>
<span style="font-size: 9pt; color: #1a206c; font-family: Arial;"></span>
<br style="font-size: 8pt;" />
<span style="font-size: 9pt; color: #1a206c; font-family: Arial; margin-bottom: 0px;">
<img src="https://www.gosafe.com/signatures/5-2021-images/location.png" border="0" alt="Location"/>
<strong style="line-height: 20px;"> 3343 Main Street, Albany, New York, 33939</strong>
</span>
</td>
</tr>
<tr style="width: 600px;">
<td style="width: 200px; padding-top: 15px; padding-bottom: 10px;">
<a href="http://www.goSafe.com">
<img src="https://www.gosafe.com/signatures/5-2021-images/goSafeLogo.png" border="0" alt="goSafe"/>
</a>
</td>
<td colspan="2" style="width: 200px; padding-top: 5px; text-align: center;">
<a title="Member of the AD Safety Network" style="text-decoration: none;" href="https://www.adhq.com">
<img src="https://www.gosafe.com/signatures/5-2021-images/ADsnPerfect.png" border="0" alt="AD Safety Network"/>
</a>
</td>
<td style="width: 200px; padding-top: 15px; padding-bottom: 10px;">
<p style="font-size: 10pt; font-family: Arial; text-decoration: none;" align="right">
<a title="goSafe on LinkedIn" style="text-decoration: none;" href="https://www.linkedin.com/company/948460">
<img src="https://www.gosafe.com/signatures/5-2021-images/li.png" border="0" alt="Linked In"/>
</a>
<a title="goSafe on FaceBook" style="text-decoration: none;" href="https://www.facebook.com/gosafesupply">
<img src="https://www.gosafe.com/signatures/5-2021-images/FB.png" border="0" alt="Facebook"/>
</a>
<a title="goSafe on Instagram" style="text-decoration: none;" href="https://www.instagram.com/gosafesupply">
<img src="https://www.gosafe.com/signatures/5-2021-images/ig.png" border="0" alt="Instagram"/>
</a>
<a title="goSafe on Twitter" style="text-decoration: none;" href="https://twitter.com/gosafesupply">
<img src="https://www.gosafe.com/signatures/5-2021-images/tw.png" border="0" alt="Twitter"/>
</a>
<br>
<a href="http://www.goSafe.com" style="text-decoration: none;">
<span style="color: #ff6400;">
<strong title="">www.goSafe.com</strong>
</span>
</a>
</p>
</td>
</tr>
<tr style="width: 600px;">
<td colspan="4">
<p style="width: 600px; padding-top: 0px; padding-bottom: 10px; font-size: 7pt; color: #1a206c; font-family: Arial;">This email and any attachments may contain confidential or proprietary information, the review and usage of which is restricted to the sender and the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies of this message and any attachments.</p>
</td>
</tr>
</table>
<br /><br />
It's 600px wide, and mobiles only have about 300px! So there is going to be downscaling or chopping or squeezing to compensate.
I'd suggest re-creating according to 'fluid design' principles.
I am currently testing out how to create a newsletter. I have made a template. I am also very new to designing. I have made a table of album releases however, it is not fitting within the border I created. How can I fix this?
I have added the code here.
Also, I want to note that I am adding the CSS into the html so a specific newsletter website can accept the newsletter. Although I was taught the other way where I create both a separate html and css file, this is how it has to be for now.
<!DOCTYPE html>
<html>
<head>
<title>NewsLetter Template</title>
<style type="text/css" >
body {
border: 5px solid #ffff;
max-width: 700px;
padding: 20px;
width: 80%;
margin: 20px auto;
}
.img1 {
width: 100%;
height:auto;
position: relative
}
.img2 {
width: 50px;
height: 50px;
position: relative
}
h2 {
background-color: red;
text-align:"center";
font-family: Helvetica;
font-size: 20px;
font-weight: bold;
text-transform: uppercase;
color: white;
}
.performance {
width: 250px;
}
p {
font-family: Helvetica;
font-size: 20px;
color: black;
}
.performancetype {
font-size: 20px;
font-family: Helvetica;
}
h3 {
font-family: Helvetica;
font-weight: 500;
}
table {
display:inline-block;
width:"100%";
}
</style>
</head>
<body>
<!-- Header -->
<div style="min-height: 100vh; position: relative; border: 5px red solid; text-align: center;">
<a href="http://www.google.com">
<img class="img1" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt="Sample"/></a>
<div>
<!-- Icons -->
<tr>
<td align="center">
<a href="http://www.google.com">
<img class="img2" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt=" Facebook" border="0"/>
</a>
<a href="http://google.com">
<img class="img2" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt=" Twitter"border="0"/>
</a>
<a href="http://google.com">
<img class="img2" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt="YouTube" border="0"/>
</a>
</td>
</tr>
</div>
<br></br>
<div>
<h2>Check Out New Releases In The Following Categories</h2>
</div>
<!-- NEW RELEASE CATEGORIES -->
<!-- BEGIN UPCOMING INSTORE//-->
<h2>Upcoming Instore Events</h2>
<!-- BEGIN IN STORE -->
<!-- PERFORMER IMAGE -->
<div>
<h2> Breakout Specials & Releases </h2>
</div>
<table>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/LOVELYLP"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/Lovely250-250x250.jpg"
alt="LOVELYTHEBAND - FINDING IT PREORDER LP" title="LOVELYTHEBAND - FINDING IT PREORDER LP" class="img-responsive" /></a></div>
<div class="caption">
<h4>LOVELYTHEBAND</h4>
<h4>FINDING IT PREORDER LP</h4>
<p>[ LP ] PREORDER FOR EVENT WRISTBAND</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/LOVELYCD"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/Lovely250-250x250.jpg"
alt="LOVELYTHEBAND - FINDING IT PREORDER CD" title="LOVELYTHEBAND - FINDING IT PREORDER CD" class="img-responsive" /></a></div>
<div class="caption">
<h4>LOVELYTHEBAND</h4>
<h4>FINDING IT PREORDER CD</h4>
<p>[ CD ] PREORDER FOR EVENT WRISTBAND</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/602567572039"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/beatles-250x250.jpg"
alt="BEATLES - YELLOW SUBMARINE (PIC DISC)" title="BEATLES - YELLOW SUBMARINE (PIC DISC)" class="img-responsive" /></a></div>
<div class="caption">
<h4>BEATLES</h4>
<h4>YELLOW SUBMARINE (PIC DISC)</h4>
<p>[ New 7 inch Vinyl ] Limited edition 7-inch vinyl picture disc now available!</p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/896308002842"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0619/clutch-250x250.JPG"
alt="CLUTCH - HOW TO SHAKE HANDS (PIC DISC)" title="CLUTCH - HOW TO SHAKE HANDS (PIC DISC)" class="img-responsive" /></a></div>
<div class="caption">
<h4>CLUTCH</h4>
<h4>HOW TO SHAKE HANDS (PIC DISC)</h4>
<p>[ New 7 inch Vinyl ] Picture disc now available!</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/840588116126"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/devil-250x250.jpg"
alt="DEVILDRIVER - OUTLAWS TIL THE END V.1" title="DEVILDRIVER - OUTLAWS TIL THE END V.1" class="img-responsive" /></a></div>
<div class="caption">
<h4>DEVILDRIVER</h4>
<h4>OUTLAWS TIL THE END V.1</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/190758510026"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/townsend-250x250.jpg"
alt="DEVIN TOWNSEND - OCEAN MACHINE: LIVE AT ANCIENT ROMAN THEATRE PLOVDIV" title="DEVIN TOWNSEND - OCEAN MACHINE: LIVE AT ANCIENT ROMAN THEATRE PLOVDIV" class="img-responsive" /></a></div>
<div class="caption">
<h4>DEVIN TOWNSEND</h4>
<h4>OCEAN MACHINE: LIVE AT ANCIENT ROMAN THEATRE PLOVDIV</h4>
<p>[ CD ] </p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/724596973523"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/goldfrapp-250x250.jpg"
alt="GOLDFRAPP - SILVER EYE (2CD/DELUXE)" title="GOLDFRAPP - SILVER EYE (2CD/DELUXE)" class="img-responsive" /></a></div>
<div class="caption">
<h4>GOLDFRAPP</h4>
<h4>SILVER EYE (2CD/DELUXE)</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/727361445225"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/immortal-250x250.jpg"
alt="IMMORTAL - NORTHERN CHAOS GODS (WHITE/BLACK)" title="IMMORTAL - NORTHERN CHAOS GODS (WHITE/BLACK)" class="img-responsive" /></a></div>
<div class="caption">
<h4>IMMORTAL</h4>
<h4>NORTHERN CHAOS GODS (WHITE/BLACK)</h4>
<p>[ LP ] Indie exclusive black and white colored vinyl LP pressing!</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/727361322021"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/immortal-250x250.jpg"
alt="IMMORTAL - NORTHERN CHAOS GODS" title="IMMORTAL - NORTHERN CHAOS GODS" class="img-responsive" /></a></div>
<div class="caption">
<h4>IMMORTAL</h4>
<h4>NORTHERN CHAOS GODS</h4>
<p>[ CD ] </p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/190296955600"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/marr-250x250.jpg"
alt="JOHNNY MARR - CALL THE COMET (PURPLE)" title="JOHNNY MARR - CALL THE COMET (PURPLE)" class="img-responsive" /></a></div>
<div class="caption">
<h4>JOHNNY MARR</h4>
<h4>CALL THE COMET (PURPLE)</h4>
<p>[ LP ] Indie exclusive purple vinyl LP pressing!</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/190758588728"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/lucifer-250x250.jpg"
alt="LUCIFER - LUCIFER II" title="LUCIFER - LUCIFER II" class="img-responsive" /></a></div>
<div class="caption">
<h4>LUCIFER</h4>
<h4>LUCIFER II</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/405053840102"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/perfect-250x250.jpg"
alt="PERFECT CIRCLE - EAT THE ELEPHANT (RED/BLUE)" title="PERFECT CIRCLE - EAT THE ELEPHANT (RED/BLUE)" class="img-responsive" /></a></div>
<div class="caption">
<h4>PERFECT CIRCLE</h4>
<h4>EAT THE ELEPHANT (RED/BLUE)</h4>
<p>[ LP ] Red and blue vinyl LP pressing!</p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/607618211523"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/murphy-250x250.jpg"
alt="PETER MURPHY - 5 ALBUMS" title="PETER MURPHY - 5 ALBUMS" class="img-responsive" /></a></div>
<div class="caption">
<h4>PETER MURPHY</h4>
<h4>5 ALBUMS</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/4050538388558"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/tiger-250x250.jpg"
alt="TIGER ARMY - DARK PARADISE (COLORED VINYL W/DL)" title="TIGER ARMY - DARK PARADISE (COLORED VINYL W/DL)" class="img-responsive" /></a></div>
<div class="caption">
<h4>TIGER ARMY</h4>
<h4>DARK PARADISE (COLORED VINYL W/DL)</h4>
<p>[ New 7 inch Vinyl ] </p>
</div>
</td>
</tr>
</body>
</html>
When you run it, the new releases look like this
Screenshot
What should I do?
Thanks in advance.
Let the images have dynamic sizing:
.img-responsive{
width: 100%;
height: auto;
}
They'll fill the <td>'s width 100% (and no more) and the height will be dynamically sized to retain the original aspect ratio. This is useful for rectangular images such as the Yellow Submarine album in your example.
Apply width: 100% to those images which are inside table cells. This will fit them exactly into the table cells, no matter how large they are:
td img {
width: 100%;
}
<!DOCTYPE html>
<html>
<head>
<title>NewsLetter Template</title>
<style type="text/css" >
body {
border: 5px solid #ffff;
max-width: 700px;
padding: 20px;
width: 80%;
margin: 20px auto;
}
.img1 {
width: 100%;
height:auto;
position: relative
}
.img2 {
width: 50px;
height: 50px;
position: relative
}
h2 {
background-color: red;
text-align:"center";
font-family: Helvetica;
font-size: 20px;
font-weight: bold;
text-transform: uppercase;
color: white;
}
.performance {
width: 250px;
}
p {
font-family: Helvetica;
font-size: 20px;
color: black;
}
.performancetype {
font-size: 20px;
font-family: Helvetica;
}
h3 {
font-family: Helvetica;
font-weight: 500;
}
table {
display:inline-block;
width:"100%";
}
</style>
</head>
<body>
<!-- Header -->
<div style="min-height: 100vh; position: relative; border: 5px red solid; text-align: center;">
<a href="http://www.google.com">
<img class="img1" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt="Sample"/></a>
<div>
<!-- Icons -->
<tr>
<td align="center">
<a href="http://www.google.com">
<img class="img2" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt=" Facebook" border="0"/>
</a>
<a href="http://google.com">
<img class="img2" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt=" Twitter"border="0"/>
</a>
<a href="http://google.com">
<img class="img2" src="https://i.kym-cdn.com/entries/icons/original/000/003/338/320px--Insert_image_here-.svg.png" alt="YouTube" border="0"/>
</a>
</td>
</tr>
</div>
<br></br>
<div>
<h2>Check Out New Releases In The Following Categories</h2>
</div>
<!-- NEW RELEASE CATEGORIES -->
<!-- BEGIN UPCOMING INSTORE//-->
<h2>Upcoming Instore Events</h2>
<!-- BEGIN IN STORE -->
<!-- PERFORMER IMAGE -->
<div>
<h2> Breakout Specials & Releases </h2>
</div>
<table>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/LOVELYLP"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/Lovely250-250x250.jpg"
alt="LOVELYTHEBAND - FINDING IT PREORDER LP" title="LOVELYTHEBAND - FINDING IT PREORDER LP" class="img-responsive" /></a></div>
<div class="caption">
<h4>LOVELYTHEBAND</h4>
<h4>FINDING IT PREORDER LP</h4>
<p>[ LP ] PREORDER FOR EVENT WRISTBAND</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/LOVELYCD"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/Lovely250-250x250.jpg"
alt="LOVELYTHEBAND - FINDING IT PREORDER CD" title="LOVELYTHEBAND - FINDING IT PREORDER CD" class="img-responsive" /></a></div>
<div class="caption">
<h4>LOVELYTHEBAND</h4>
<h4>FINDING IT PREORDER CD</h4>
<p>[ CD ] PREORDER FOR EVENT WRISTBAND</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/602567572039"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/beatles-250x250.jpg"
alt="BEATLES - YELLOW SUBMARINE (PIC DISC)" title="BEATLES - YELLOW SUBMARINE (PIC DISC)" class="img-responsive" /></a></div>
<div class="caption">
<h4>BEATLES</h4>
<h4>YELLOW SUBMARINE (PIC DISC)</h4>
<p>[ New 7 inch Vinyl ] Limited edition 7-inch vinyl picture disc now available!</p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/896308002842"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0619/clutch-250x250.JPG"
alt="CLUTCH - HOW TO SHAKE HANDS (PIC DISC)" title="CLUTCH - HOW TO SHAKE HANDS (PIC DISC)" class="img-responsive" /></a></div>
<div class="caption">
<h4>CLUTCH</h4>
<h4>HOW TO SHAKE HANDS (PIC DISC)</h4>
<p>[ New 7 inch Vinyl ] Picture disc now available!</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/840588116126"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/devil-250x250.jpg"
alt="DEVILDRIVER - OUTLAWS TIL THE END V.1" title="DEVILDRIVER - OUTLAWS TIL THE END V.1" class="img-responsive" /></a></div>
<div class="caption">
<h4>DEVILDRIVER</h4>
<h4>OUTLAWS TIL THE END V.1</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/190758510026"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/townsend-250x250.jpg"
alt="DEVIN TOWNSEND - OCEAN MACHINE: LIVE AT ANCIENT ROMAN THEATRE PLOVDIV" title="DEVIN TOWNSEND - OCEAN MACHINE: LIVE AT ANCIENT ROMAN THEATRE PLOVDIV" class="img-responsive" /></a></div>
<div class="caption">
<h4>DEVIN TOWNSEND</h4>
<h4>OCEAN MACHINE: LIVE AT ANCIENT ROMAN THEATRE PLOVDIV</h4>
<p>[ CD ] </p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/724596973523"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/goldfrapp-250x250.jpg"
alt="GOLDFRAPP - SILVER EYE (2CD/DELUXE)" title="GOLDFRAPP - SILVER EYE (2CD/DELUXE)" class="img-responsive" /></a></div>
<div class="caption">
<h4>GOLDFRAPP</h4>
<h4>SILVER EYE (2CD/DELUXE)</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/727361445225"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/immortal-250x250.jpg"
alt="IMMORTAL - NORTHERN CHAOS GODS (WHITE/BLACK)" title="IMMORTAL - NORTHERN CHAOS GODS (WHITE/BLACK)" class="img-responsive" /></a></div>
<div class="caption">
<h4>IMMORTAL</h4>
<h4>NORTHERN CHAOS GODS (WHITE/BLACK)</h4>
<p>[ LP ] Indie exclusive black and white colored vinyl LP pressing!</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/727361322021"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/immortal-250x250.jpg"
alt="IMMORTAL - NORTHERN CHAOS GODS" title="IMMORTAL - NORTHERN CHAOS GODS" class="img-responsive" /></a></div>
<div class="caption">
<h4>IMMORTAL</h4>
<h4>NORTHERN CHAOS GODS</h4>
<p>[ CD ] </p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/190296955600"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/marr-250x250.jpg"
alt="JOHNNY MARR - CALL THE COMET (PURPLE)" title="JOHNNY MARR - CALL THE COMET (PURPLE)" class="img-responsive" /></a></div>
<div class="caption">
<h4>JOHNNY MARR</h4>
<h4>CALL THE COMET (PURPLE)</h4>
<p>[ LP ] Indie exclusive purple vinyl LP pressing!</p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/190758588728"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/lucifer-250x250.jpg"
alt="LUCIFER - LUCIFER II" title="LUCIFER - LUCIFER II" class="img-responsive" /></a></div>
<div class="caption">
<h4>LUCIFER</h4>
<h4>LUCIFER II</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/405053840102"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/perfect-250x250.jpg"
alt="PERFECT CIRCLE - EAT THE ELEPHANT (RED/BLUE)" title="PERFECT CIRCLE - EAT THE ELEPHANT (RED/BLUE)" class="img-responsive" /></a></div>
<div class="caption">
<h4>PERFECT CIRCLE</h4>
<h4>EAT THE ELEPHANT (RED/BLUE)</h4>
<p>[ LP ] Red and blue vinyl LP pressing!</p>
</div>
</td>
</tr>
<tr>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/607618211523"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/murphy-250x250.jpg"
alt="PETER MURPHY - 5 ALBUMS" title="PETER MURPHY - 5 ALBUMS" class="img-responsive" /></a></div>
<div class="caption">
<h4>PETER MURPHY</h4>
<h4>5 ALBUMS</h4>
<p>[ CD ] </p>
</div>
</td>
<td width="25%" style="font-family: Helvetica, sans-serif; font-size: 10px;" align="center" valign="top">
<div class="image"><a href="http://vvinyl.com/shop/4050538388558"><img src="http://vvinyl.com/shop/image/cache/catalog/2018/0703/tiger-250x250.jpg"
alt="TIGER ARMY - DARK PARADISE (COLORED VINYL W/DL)" title="TIGER ARMY - DARK PARADISE (COLORED VINYL W/DL)" class="img-responsive" /></a></div>
<div class="caption">
<h4>TIGER ARMY</h4>
<h4>DARK PARADISE (COLORED VINYL W/DL)</h4>
<p>[ New 7 inch Vinyl ] </p>
</div>
</td>
</tr>
</body>
</html>
I have a fiddle which I have replicated by seeing the screenshot below:
The CSS code which I have used for the individual square box item is:
.product-contents .product {
width: 10%;
text-align: center;
height: 150px;
padding-top: 1%;
padding-left: 1%;
padding-right: 1%;
border-style: solid;
border-width: 3px;
border-color: rgb(145, 147, 150);
background-color: white;
border-radius: 10px
}
Problem Statement:
Now in the mobile view, I want the items in the screenshot to horizontally scroll in the mobile/tablet view without any change in size of an item. In order to do that, I have used the following CSS code but it doesn't seem to work.
#media only screen and (max-width: 767px)
.product-all-contents {
overflow-x: auto;
white-space: nowrap;
}
I am wondering what changes I should make in the fiddle so that the whole screenshot scroll in the mobile/tablet view.
You're on the right tracks, but you can't use white-space: nowrap in this instance, since using that method is reserved for when you're using the inline-block method of creating a horizontal scroll. There is a flexbox property though called flex-wrap which when we set to nowrap it does a similar thing.
See updated fiddle: https://jsfiddle.net/utmyu5r6/4/
The main problem is that the items and their parents have a dinamic width. Items being on 10% and its parent to 70%.
I would recommend using the next style inside your media query. You can adapt this rule to different breakpoints as you need.
.product-contents .product{
min-width: 25%;
max-width: 25%;
margin: 0 2%;
}
I had to remove all of the JS and some HTML to make the snippet work. Your code hit the max of SO.
Hope this helps :>
.product-all-contents{
background-color: #f0f0f0;
width: 70%;
margin: auto;
}
.product-contents {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
}
.product-contents .product {
width: 10%;
text-align: center;
height: 150px;
padding-top: 1%;
padding-left: 1%;
padding-right: 1%;
border-style: solid;
border-width: 3px;
border-color: rgb(145, 147, 150);
background-color: white;
border-radius: 10px
}
.ipads {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
}
.tvs {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
}
.franchise-hub-text, .cloud-based-text, .business-analytics-text, .tech-support-text, .order-management-text, .employee-management-text, .white-label-text,
.brand-label-text, .lead-tracking-text, .custom-invoicing-text, .goal-setting-text, .customization-tools-text, .royalty-calculator-text, .email-marketing-text
{
width: 50%;
}
div.goal-setting, div.customization-tools, div.custom-invoicing, div.lead-tracking, div.email-marketing, div.royalty-calculator, div.brand-control,
div.franchisehubtv, div.cloudbasedtextipad, div.business-analytics,div.tech-support, div.employee-management, div.order-management, div.white-label {
display: flex;
margin-left: 15%;
margin-right: 15%;
align-items: center;
background-color: #f0f0f0;
padding: 2%;
margin-bottom: 5%;
}
.product-quotes
{
display: block;
padding: 20px 11px;
width: 90%;
color:#3b3b3d;
background: white;
border-radius: 2px;
line-height: 1.625;
font-family: 'Roboto';
font-weight: normal;"
}
.arrow-down {
width: 0;
height: 0;
margin: auto;
border-left: 40px solid transparent;
border-right: 40px solid transparent;
border-top: 40px solid #f0f0f0;
}
.white
{
display: none;
}
#media only screen and (max-width: 767px)
{
.product-all-contents
{
overflow-x: auto;
}
.product-contents .product{
min-width: 25%;
max-width: 25%;
margin: 0 2%;
}
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Testing</title>
<link rel="stylesheet" href="sample.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="script/myscript.js"></script>
</head>
<body>
<div class="product-all-contents">
<div class="product-contents">
<div class="product" id="franchisehub">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Franchise-Hub.png" alt="" width="59" height="59" class="aligncenter size-full wp-image-7920">
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/franchise-hub-white.png" alt="" width="59" height="59" class="aligncenter size-full wp-image-7920">
<p style=" font-size: 15px; font-family: 'Roboto'; margin-left: 7%; margin-right: 7%; line-height: 1.2; margin-top: 20%;
color: rgb(58, 59, 60);">Franchise Hub</p>
</div>
<div class="product" id="cloudbasedmobile" style="background-color:#81bf44;">
<img class="black" style="display:none;" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/cloud-grey.png" alt="" width="70" height="50" class="aligncenter size-full wp-image-8020" />
<img class="white" style="display:inline-block;" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/cloud-based-mobile-white.png" alt="" width="70" height="50" class="aligncenter size-full wp-image-8020" />
<p style=" font-size: 15px;
font-family: 'Roboto';line-height:1.2; margin-top: 27%;
color:white;">Cloud Based & Mobile</p>
</div>
<div class="product" id="businessanalytics">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/business-analytics.png" alt="" width="53" height="53" class="aligncenter size-full wp-image-7949" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/business-analytics-white.png" alt="" width="53" height="53" class="aligncenter size-full wp-image-7949" />
<p style=" font-size: 15px;
font-family: 'Roboto';line-height:1.2; margin-top: 22%;
color: rgb(58, 59, 60);">Business Analytics</p>
</div>
<div class="product" id="techsupport">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/tech-support.png" alt="" width="54" height="54" class="aligncenter size-full wp-image-7953" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/tech-support-white.png" alt="" width="54" height="54" class="aligncenter size-full wp-image-7953" />
<p style=" font-size: 15px;
font-family: 'Roboto';
margin-right: 9%;
line-height: 1.2;
margin-left: 9%; margin-top: 22%;
color: rgb(58, 59, 60);">Tech Support</p>
</div>
<div class="product" id="ordermanagement">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/order-management.png" alt="" width="43" height="52" class="aligncenter size-full wp-image-7952" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/order-management-white.png" alt="" width="43" height="52" class="aligncenter size-full wp-image-7952" />
<p style=" font-size: 15px;
font-family: 'Roboto';line-height:1.2; margin-top: 23%;
color: rgb(58, 59, 60);">Order Management</p>
</div>
<div class="product" id="employeemanagement">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/employee-management.png" alt="" width="59" height="59" class="aligncenter size-full wp-image-7920">
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/employee-management-white.png" alt="" width="59" height="59" class="aligncenter size-full wp-image-7920">
<p style=" font-size: 15px;
font-family: 'Roboto';line-height:1.2; margin-left: 5%; margin-top: 27%;
color: rgb(58, 59, 60);">Employee Management</p>
</div>
<div class="product" id="whitelabel">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/white-label.png" alt="" width="59" height="59" class="aligncenter size-full wp-image-7920">
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/white-label-white.png" alt="" width="59" height="59" class="aligncenter size-full wp-image-7920">
<p style="
font-size: 15px;
font-family: 'Roboto';
line-height:1.2;
margin-left: 14%;
margin-right: 14%; margin-top: 8%;
color: rgb(58, 59, 60);
">White Label</p>
</div>
</div>
<div class="product-contents">
<div class="product" id="brandcontrol">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/brand-control.png" alt="" width="57" height="57" class="aligncenter size-full wp-image-7956" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/brand-control-white.png" alt="" width="57" height="57" class="aligncenter size-full wp-image-7956" />
<p style="
font-size: 15px;
font-family: 'Roboto';
margin-left: 8%;
line-height:1.2;
margin-right: 8%; margin-top: 20%;
color: rgb(58, 59, 60);
">Brand Control</p>
</div>
<div class="product" id="leadtracking">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/lead-tracking.png" alt="" width="50" height="50" class="aligncenter size-full wp-image-7957" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/lead-tracking-white.png" alt="" width="50" height="50" class="aligncenter size-full wp-image-7957" />
<p style="
font-size: 15px;
font-family: 'Roboto';
line-height:1.2;
margin-left: 5%;
margin-right: 5%; margin-top: 26%;
color: rgb(58, 59, 60);
">Lead Tracking & CRM</p>
</div>
<div class="product" id="custominvoicing">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/custom-invoicing.png" alt="" width="51" height="50" class="aligncenter size-full wp-image-7958" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/custom-invoicing-white.png" alt="" width="51" height="50" class="aligncenter size-full wp-image-7958" />
<p style=" font-size: 15px;
font-family: 'Roboto';line-height:1.2; margin-top: 24%;
color: rgb(58, 59, 60);">Custom Invoicing</p>
</div>
<div class="product" id="goalsetting">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/goal-setting.png" alt="" width="50" height="51" class="aligncenter size-full wp-image-7959" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/goal-setting-white.png" alt="" width="50" height="51" class="aligncenter size-full wp-image-7959" />
<p style="font-size: 15px;
font-family: 'Roboto';
margin-right: 13%;
margin-left: 13%;
line-height: 1.2; margin-top: 24%;
color: rgb(58, 59, 60);">Goal Setting</p>
</div>
<div class="product" id="customizationtools">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/customization-tools.png" alt="" width="54" height="53" class="aligncenter size-full wp-image-7960" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/customization-tools-white.png" alt="" width="54" height="53" class="aligncenter size-full wp-image-7960" />
<p style=" font-size: 15px;
font-family: 'Roboto';line-height:1.2; margin-top: 22%;
color: rgb(58, 59, 60);">Customization Tools</p>
</div>
<div class="product" id="royaltycalculator">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/royalty-calculator.png" alt="" width="50" height="51" class="aligncenter size-full wp-image-7961" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/royalty-calculator-white.png" alt="" width="50" height="51" class="aligncenter size-full wp-image-7961" />
<p style=" font-size: 15px;
font-family: 'Roboto';line-height:1.2; margin-left: 5%; margin-top: 23%;
color: rgb(58, 59, 60);">Royalty Calculator</p>
</div>
<div class="product" id="emailmarketing">
<img class="black" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/email-marketing.png" alt="" width="51" height="52" class="aligncenter size-full wp-image-7962" />
<img class="white" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/06/email-marketing-white.png" alt="" width="51" height="52" class="aligncenter size-full wp-image-7962" />
<p style="
font-size: 15px;
font-family: 'Roboto';
margin-left: 5%;
margin-right: 5%;
line-height:1.2; margin-top: 21%;
color: rgb(58, 59, 60);
">Email Marketing</p>
</div>
</div>
</div>
<div class="arrow-down"></div>
<div class="franchisehubtv" style="display:none;">
<div class="franchise-hub-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/franchise-hub-green.png" alt="" width="53" height="53" style="margin-bottom:5%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Franchise Hub</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Franchise management hubs allow you to support your entire franchise network efficiently and transparently. Branding, invoicing, royalties, products and services, are organized by corporate, and then funneled down through the network as desired.
</p>
Learn More
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Franchise-Hub-1.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="cloudbasedtextipad" style="display:flex;">
<div class="cloud-based-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/cloud-based-mobile-green.png" alt="" width="53" height="53" style="margin-bottom:10%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Cloud Based & Mobile</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>We’re cloud based and mobile first, which means you can access everything you need, no matter where you are. The app lets you run your business without compromising any features or power, so employees are able to check in from worksites and stay up to date.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Cloud-Based-Mobile.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="business-analytics" style="display:none;">
<div class="business-analytics-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/business-analytics-green.png" alt="" width="53" height="53" style="margin-bottom:9%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Business Analytics</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Our business analytics and reports let you see real-time information on everything from hours worked to open orders and payments accepted. All your important daily figures, at a glance.
</p>
Learn More
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Business-Anylitics.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="tech-support" style="display:none;">
<div class="tech-support-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/tech-support-green.png" alt="" width="53" height="53" style="margin-bottom:13%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Tech Support</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Whether you, any of your franchisees, or their staff ever need help with BPro software, our support team is a quick online chat, email, or phone call away.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Tech-Support.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="order-management" style="display:none;">
<div class="order-management-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/order-management-green.png" alt="" width="53" height="53" style="margin-bottom:11%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Order Management</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Control your sales pipeline with our customizable and consistent order management system. Reference current orders, create new ones, duplicate existing orders and more.
</p>
Learn More
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Order-Managment.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="employee-management" style="display:none;">
<div class="employee-management-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/employee-management-green.png" alt="" width="53" height="53" style="margin-bottom:11%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Employee Managment</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Simplify your human resources and keep track of important details like employee start dates, birthdays, and payroll, all while being able to keep track of where and when everyone is being most effective.
</p>
Learn More
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Employee-Managment.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="white-label" style="display:none;">
<div class="white-label-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/white-label-green.png" alt="" width="53" height="53" style="margin-bottom:10%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">White Label</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Sure, we made BPro, but we want it to really be your business software. Your templates, your colours, your logo, your language.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Brand-Control.png" alt="" width="450" height="450"class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="brand-control" style="display:none;">
<div class="brand-control-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/brand-control-green.png" alt="" width="53" height="53" style="margin-bottom:9%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Brand Control</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p >Control your brand across all locations, even internationally with our customizable templates, logo, language and branded colour options. No two locations will ever generate different invoices ever again (unless you want them to).
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Brand-Control.png" alt=""width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="lead-tracking" style="display:none;">
<div class="lead-tracking-text">
<img id="lead-tracking" src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/lead-tracking-green.png" alt="" width="53" height="53" style="margin-bottom:9%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Lead Tracking & CRM</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Take your sales and customer service to the next level with a customer relationship manager designed specifically with franchises and multi-location businesses in mind. Featuring automation, filtering and more.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Lead-Tracking-1.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="custom-invoicing" style="display:none;">
<div class="custom-invoicing-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/custom-invoicing-green.png" alt="" width="53" height="53" style="margin-bottom:13%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Custom Invoicing</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Our custom invoicing lets you create consistent, professional and personalized invoices that link directly to a payment processing system.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Custom-Invoicing.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="goal-setting" style="display:none;">
<div class="goal-setting-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/goal-setting-green.png" alt="" width="53" height="53" style="margin-bottom:13%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Goal Setting</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Goals are important! Make sure they’re communicated throughout your franchise network with our goal setting tool. Different goals for different locations or hubs? No problem.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Goal-Setting.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="customization-tools" style="display:none;">
<div class="customization-tools-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/customization-tools-green.png" alt="" width="53" height="53" style="margin-bottom:13%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Customization Tools</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>Flexibility to customize your software including the addition of your logo, brand colours, language, and so much more. Your business, your software.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Customization-Tools.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="royalty-calculator" style="display:none;">
<div class="royalty-calculator-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/royalty-calculator-green.png" alt="" width="53" height="53" style="margin-bottom:4%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Royalty Calculator</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397;margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p>No more complicated calculations when it comes to royalties. With our royalty calculator, you can set unique royalty rules for each location, or apply the same template across the board. Ensure consistency every billing period with the same system, and confirm numbers with our royalty reports.
</p>
Learn More
</div>
</div>
<div class="tvs">
<div class="tv">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/Royalties.png" alt="" width="450" height="450" class="aligncenter size-full wp-image-8081">
</div>
</div>
</div>
<div class="email-marketing" style="display:none;">
<div class="email-marketing-text">
<img src="https://thebettersoftwarecompany.com/wp-content/uploads/2018/05/email-marketing-green.png" alt="" width="53" height="53" style="margin-bottom:4%;">
<h6 style="color:black;font-family:'Roboto';font-weight:normal;">Email Marketing</h6>
<p style="font-family: 'Roboto'; font-weight: normal;color:#929397; margin-bottom:2.3%;">Software that works the way you do</p>
<div class="product-quotes">
<p> With a franchise or multi-location business, we know you don’t always want all customers to be connected to the same email campaign, that’s why we established an integration with Emma. Keep things running with automated campaigns and customer info pushes from BPro to Emma.
</p>
<a style="float:right;">Learn More</a>
</div>
</div>
</div>
</body>
</html>
I want the text of left div to be center of the div according to the contents of right div.
<div class="row">
<div class="" style="float:left">
<p style="color: #222;margin-bottom: 0; text-align:center;">08:30 - 09:30</p>
</div>
<div class=" agenda_name" style=" float:right;">
<p style="font-weight: 400;">XYZXYZX</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
</div>
</div>
expected output is in the image.
Thank You.
Try below html and css code and remove inline css float:left; and float:right from you div.
.section {
display: table;
height: inherit;
max-height: 100%;
width: 100%;
}
.row.content {
display: table-row;
height: 100%;
width: 100%;
}
.left_div {
display: table-cell;
vertical-align: middle;
width: 50%; /* set width as per you needed */
}
.right_div {
display: table-cell;
vertical-align: middle;
width: 50%; /* set width as per you needed */
}
.left_div > p {
text-align: center;
}
<div class="section">
<div class="row content">
<div class="left_div" style="">
<p>08:30 - 09:30</p>
</div>
<div class="right_div agenda_name" style="">
<p style="font-weight: 400;">XYZXYZX</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
</div>
</div>
</div>
Give heigth to both left and right divs. Set display:table to parent div and display:table-cell and vertical-align:middle; to child element of the left div to center vertically and horizandally
.leftdiv,
.agenda_name {
width: 50%;
height: 152px;
}
.leftdiv {
display: table;
}
.leftdiv p {
vertical-align: middle;
display: table-cell;
}
<div class="row">
<div class="leftdiv" style="float:left">
<p style="color: #222;margin-bottom: 0; text-align:center;">08:30 - 09:30</p>
</div>
<div class="agenda_name" style=" float:right;">
<p style="font-weight: 400;">XYZXYZX</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
</div>
</div>
Remove float:left to the div
Add margin: 0 auto and display:table to p tag
<div class="row">
<div class="">
<p style="color: #222;margin-bottom: 0; margin: 0 auto; display:table;">08:30 - 09:30</p>
</div>
<div class=" agenda_name" style=" float:right;">
<p style="font-weight: 400;">XYZXYZX</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
</div>
</div>
<div class="row">
<div class="" style="float:left; height: 30%; width:50%;">
<p style="color: #222;margin-bottom: 0; text-align:center; margin-top: 25%">08:30 - 09:30</p>
</div>
<div class=" agenda_name" style=" float: right;height: 30%;width:50%;">
<p style="font-weight: 400;">XYZXYZX</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
<p style="font-weight: 400;">XYZXYZ Xdssgg</p>
</div>
</div>