Need help figuring this out. I've tried adding additional margins and padding to the text and also cells in the hope it resolves but haven't been successful.
The issue only happens in chrome
Here is some code. this is the master print.css
#page
{
size: size 21cm 29.5cm portrait;
margin: 1.3cm;
}
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* -- Page Layout
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
body { padding: 0px; margin: 0px; }
div.OuterShell { width: 100%; border: none !important; padding: 0px; margin: 0px; }
div.InnerShell { width: 100%; border: none !important; padding: 0px; margin: 0px; }
div.OuterShell { box-shadow: none; }
div.CollapseButtons, .ajax__tab_outer, .TableOptions{ display:none !important; visibility:hidden; }
div.Header { display: none; }
div.Footer { display: none; }
div.ContentHolder { padding: 0px; margin: 0px; width: 100%; }
div.LeftColumn { display: none !important; }
div.RightColumn { display: none; }
div.Submit, div.HSStatusIcon, div.Banner { display: none; }
div.MiddleColumn { margin: 0 !important; padding: 0 !important; border: none; width: auto !important; display: block !important; }
div.MiddleColumn3Col { margin: 0px; border: none; width: 100%; }
div.LoginStatus { display: none; }
div.MainMenu { display: none; }
div.SubMenu { display: none; }
div.CopyrightHolder { display: none; }
div.ReportTitle { display: none; }
div.ReportControls { display: none; }
div.FloatingOptions, .PrintHide, .ActionOptions, .InformationIcons { display: none; border: none !important; }
#tdAlerts { display:none; visibility:hidden !important;}
#thAlerts { display:none; visibility:hidden !important;}
#tdOptions { display:none; visibility:hidden !important;}
td.Notes { display:none; visibility:hidden !important;}
div.crumbs {display:none;}
a.DatePicker {display:none;}
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
.PrintShow { visibility:visible !important; display:block !important; }
div.OuterShell
{
padding: 0 !important;
box-shadow: none !important;
}
div.ContentHolder
{
margin: 0 !important
}
div.MiddleColumn h1,
div.MiddleColumn3Col h1,
div.MiddleColumn1Col h1
{
color: #333333 !important;
font-family: inherit !important;
background-color: White !important;
text-transform: none !important;
font-size: 24px !important;
border-bottom: 0 !important;
}
div.InputGrid h3
{
color: #333333 !important;
background-color: #ffffff !important;
border-color: #cccccc !important;
}
div.InputGrid table
{
border-color: #cccccc !important;
}
div.InputGrid td.Label
{
border-color: #cccccc !important;
color: #333333 !important;
}
the page also pulls another print css sheet called paperwork. here it is
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* -- Setup Page for Print
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
#page
{
size: size 21cm 29.5cm portrait;
margin: 1.3cm;
}
#media print
{
body { font-family: Arial; font-size: 11pt; padding: 0px !important; }
div.PaperWorkOuterShell { width: 100% !important; padding: 0px !important; margin: 0px !important; }
div.PaperWorkInnerShell { width: 100% !important; margin: 0px !important; }
div.PageBreak { page-break-before: always; border: none !important; }
div.PageBreakFix { height:1px; overflow:hidden; font-size:0px; }
div.Warning { display: none; margin:0 !important; }
div.PaperWorkContent { margin-bottom: 30px; }
div.NoPrint { display:none; margin: 0 !important; }
}
#media screen
{
div.PaperWorkContent { margin-bottom: 20px; }
div.PageBreak { margin-bottom: 30px; border-top: 1px dashed #999; }
}
/*-----------------------------------------------------------------------------
//-- PAPERWORK LOGO CSS
//---- A client may need this in their paperwork.css to resize the coords main paperwork logos
-----------------------------------------------------------------------------*/
div.PaperWorkHeader div.Logo { width: 200px; height:70px; overflow:hidden; text-align:center; margin: 0 auto 20px; }
div.PaperWorkHeader div.Logo img { max-height:70px; max-width: 200px; }
* html div.PaperWorkHeader div.Logo { width:200px; height:70px; } /* IE6 Fix as it doesnt support max-width/height */
* html div.PaperWorkHeader div.Logo img { height:70px; width:auto; }
div.PositionRight { position: absolute; top: 0; right: 0; }
/*-----------------------------------------------------------------------------
//-- For coord's coverletter
//---- A client may need this in their paperwork.css to resize logos on coord coverletters (e.g. LEBC contracts)
-----------------------------------------------------------------------------*/
div.Coverletter div.CoverLogo { width:300px; height:100px; overflow:hidden; text-align:right; }
div.Coverletter div.CoverLogo img { max-width:300px; max-height:100px; }
* html div.PaperWorkHeader div.CoverLogo img { height:100px; width:auto; }
/*-----------------------------------------------------------------------------
//-- For admin's coverletter
//---- A client may need this in their paperwork.css to resize logos on admin specific coverletters (e.g. ELI reminders)
-----------------------------------------------------------------------------*/
div.AdminHeader div.CoverLogo { height:80px; max-height:80px; overflow:hidden; text-align:right; }
div.AdminHeader div.CoverLogo img{ height:80px; max-height:80px }
* html div.AdminHeader div.CoverLogo, * html div.AdminHeader div.CoverLogo img { height:80px; }
/* some default coverletter stlying */
div.CoverletterContent, div.Coverletter { position:relative; }
div.CoverLetterAddress { top:60px; left:0px; text-align:left; }
div.CoverLetterAddress p{ line-height:1.4em; font-size:100%; margin:0 !important; padding:0 !important; }
div.CoverLetterHeader,
div.Coverletter div.RowHolder { background:none !important; }
div.Coverletter { height:auto !important; text-align:right; }
.Window
{
margin-top:15px !important;
}
.Window-Extended
{
margin-top:20px !important;
}
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* -- Redefine HTML tags
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
body { padding: 0 20px; background: #EEE; color: #000; font-family: Arial; font-size: 10pt; }
form { padding: 0px; margin: 0px; }
hr { color: #999; border-color: #999; }
hr { color: #FFF; background: none; border-bottom: 1px solid #999; height: 1px; margin: 20px 0px 5px; padding: 0px; }
hr.Dotted { border: 0; padding: 0; border-bottom: 1px dotted #999; }
a.:link, a:visited, a:hover { color: #000; text-decoration: none; }
a.PaperworkLink:link, a.PaperworkLink:visited, a.PaperworkLink:hover { color: #006699; text-decoration: underline; }
/* fix IE7 */
*:first-child+html hr { margin: 5px 0px 0px; }
*:first-child+html hr.Top { margin-top: 10px; }
/* fix IE 6 */
* html hr { margin: 5px 0px 0px; }
* html hr.Top { margin-top: 10px; }
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* -- Paperwork Page Layout
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
div.Error img { float: left; margin: 7px; }
div.Error { position:relative; padding: 10px 10px 10px 40px; }
div.Error { color: #CC0000; border: 1px solid #E47676; margin: 0px 0px 20px; background: #FAE5E5 url('../Images/Icons/MessageBox/critical.gif') no-repeat scroll 7px 50%; }
div.Error div.Container p, div.Error div.Container h2 { background:#ea6154; }
div.Error div.Icon { background: url('../Images/Icons/MessageBox/Error_Important.png') no-repeat scroll 5px 50% !important; }
div.Error div.Icon_Lrg { background: url('../Images/Icons/MessageBox/Error_Important_Lrg.png') no-repeat scroll 0 50% !important; }
div.Error div.AreaEmployer div.Icon { background: url('../Images/Icons/MessageBox/Error_EmpArea.png') no-repeat scroll 0 50% !important; }
div.Error div.AreaEmployer div.Icon_Lrg { background: url('../Images/Icons/MessageBox/Error_EmpArea_Lrg.png') no-repeat scroll 0 50% !important; }
div.Error div.AreaPlacement div.Icon { background: url('../Images/Icons/MessageBox/Error_EmpArea.png') no-repeat scroll 0 50% !important; }
div.Error div.AreaPlacement div.Icon_Lrg { background: url('../Images/Icons/MessageBox/Error_EmpArea_Lrg.png') no-repeat scroll 0 50% !important; }
div.Warning { padding: 8px; background: #FFFFCC; border: 1px solid #CC9933; color: #990000; }
div.Declaration { padding: 8px; background: #CCCCFF; border: 1px solid #000099; color: #000066; }
div.AgreedBy { font-size: 8pt; }
div.PaperWorkOuterShell { width: 700px; padding: 20px 0px; background: #FFF; }
div.PaperWorkInnerShell { width: 650px; margin: 0px auto; background: #FFF; color: #000; }
div.PaperWorkHeader { position: relative; height:140px;}
div.Slim {height:10px !important;}
div.PaperWorkHeader div.Title { position: absolute; left: 0px; bottom: 10px; font-size: 14pt; }
div.PaperWorkHeader div.Central { position: relative; text-align: center; margin: 20px 0px 0px; }
div.PaperWorkHeader div.Central_lrebp { width:100%; text-align:center; bottom:0px; }
div.PaperWorkHeader div.Address { position: absolute; left: 0px; top: 10px; font-size: 8pt; }
div.PaperWorkHeader div.OppID, div.OppIDHS { position: absolute; right: 0px; bottom: 10px; font-size: 8pt; }
div.PaperWorkHeader div.OppID span.LeftBordered, .LeftBordered { border-left: 1px solid #CCC; margin-left: 6px; padding-left: 6px; }
div.PageNumber { position: relative; text-align:right; font-size: 8pt; }
div.PaperWorkHeader div.PageNumber { position: absolute; right: 0px; top: 10px; font-size: 8pt; }
/* This is used when a page number appears in the top right corner and the header needs to float back up to remain aligned*/
div.TopFloat { top:-30px !important; }
div.Reminder p { font-size:120%; line-height:1.5em; }
div.Reminder h1 { border:none !important; width:auto; text-decoration:underline; padding:0 !important; }
div.PaperWorkContent { font-size: 8pt; }
div.PaperWorkContent h1 { border-bottom: 3px solid #000; font-size: 12pt; padding: 5px 12px; margin: 0px; }
div.PaperWorkContent h2 { margin: 0px 0px 2px; font-size: 100%; font-weight: bold; border: none; }
div.PaperWorkContent h2.SubHeading { font-size:120% !important; margin:0 0 5px 0; }
div.PaperWorkContent p { margin: 13px 0px; }
div.PaperWorkContent ul { margin: 0px 0px 0px 15px; padding: 0px; }
/* fix IE 6/7 */
* html div.PaperWorkContent ul,
*:first-child+html div.PaperWorkContent ul { margin-left: 15px; }
.DateBottom { border-bottom: 1px dotted #999;width:100px;display:inline-block; }
/* CLEAN STYLE - KS DEV ---------------------------------------------------------------------------------------------------------------------------------------------------- */
/*Table HTML Tags*/
table { border: none; border-collapse:collapse; page-break-inside: avoid; }
table th,
table td { border: 1px solid #AAA; margin: 0 !important; padding:5px; }
table th { background-color:#ccc !important; }
/*Table Text Tags*/
table h2 { vertical-align:top !important; }
/*Table Classes*/
td.Hazards { width: 23%; }
td.Risks { width: 23%; }
td.ControlMeasures { width: 30%; }
td.EmpControl { width: 25%; }
td.Number, td.Question, td.YesNo { padding-top: 6px; padding-bottom: 6px; }
td.Number { width: 10px; vertical-align: middle; }
td.Question { font-weight: normal; width: 230px; text-align: left; }
td.YesNo { min-width: 70px;}
td.Comments { font-weight: normal; width: 260px;}
th.Question { text-align: left; }
tr.StandardAssessment img.FirstTickBox,
img.FirstTickBox { padding-left: 0px; }
tr.StandardAssessment { background-color:#ccc; }
tr.StandardAssessment img{ padding-left: 20px; }
table.HSFormTable img { padding-left: 10px; }
td.High { background-color: #FF0000; }
td.Medium { background-color: #FFFF00; }
td.Low { background-color: #00FF00; }
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* -- Paperwork Columns
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
div.RowHolder { background: #FFF; padding: 1px; }
div.RowHolder div { background: #FFF; }
div.RowHolder div.ColumnFull { margin: 3px; padding: 8px; border: 1px solid #CCC; }
div.RowHolder div.ColumnLeftWEXReqHeader { width: 46%; float: left; margin: 3px; padding: 8px; border: 1px solid #CCC; }
div.RowHolder div.ColumnRightWEXReqHeader { width: 52%; float: right; margin: 3px; padding: 8px; border: 1px solid #CCC; }
div.RowHolder div.ColumnLeft { width: 45%; float: left; margin: 3px; padding: 8px; border: 1px solid #CCC; }
div.RowHolder div.ColumnRight { width: 45%; float: right; margin: 3px; padding: 8px; border: 1px solid #CCC; }
div.RowHolder div.TableHolder { padding: 5px; }
div.RowHolder div.NoPadding { padding: 0px; margin: 0px; }
div.Cleaner { clear: both; height: 1px; font-size: 1px; border: none; margin: 0px; padding: 0px; background: transparent; }
div.RowHolder table { width: 100%; border: none; }
div.RowHolder table th,
div.RowHolder table td { border: 1px solid #666; padding: 3px 6px; }
div.RowHolder table td.Higher { height: 30px; vertical-align:top; }
div.RowHolder table th.TickOnly,
div.RowHolder table td.TickOnly { width: 16px; }
div.RowHolder table.AvailabilityReport th { background: none; border: 0; border-bottom: 1px solid #000; text-align: left; }
div.RowHolder table.AvailabilityReport td { border: 0; text-align: left; }
div.RowHolder table.AvailabilityReport tr.MonthYear { border-top: 1px solid #CCC; font-style: italic; }
div.RowHolder table.AvailabilityReport tr.FooterNote { border-top: 1px solid #000; font-style: italic; }
div.RowHolder table.AvailabilityReport tr.FooterNote td { padding-top: 10px; }
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* -- Overrides
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
.Border { border: 3px solid #000 !important; }
.BorderTop { border-top: 3px solid #000 !important; }
.BorderRight { border-right: 3px solid #000 !important; }
.NoBorder { border: none !important; }
.Central { text-align: center; }
.NoUnderline { text-decoration: none !important; }
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* -- Padding for lists
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
ol li { padding-bottom:10px; }
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
.left { float:left; }
.right { float:right; }
.both { clear:both; }
.bold { font-weight:bold; }
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}
.Uppercase { text-transform:uppercase; }
.red { color:Red; }
.lrgFont { font-size:120%; }
.SkillsTable ul { list-style:none; margin:0 0 0 5px !important; }
Vertical padding for specific table cells should work as long as you don't have fixed height (min-height, height).
I don't know whether I am right or not but I think you are giving fixed heights and sizes in pixels.
If you investigate, you may find that the different browsers have different default values for things like margins, padding, text size, font face, etc. That's probably what's tripping you up
also, I would be able to help you more if you share some code snippet
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want a text box to appear when a user or client is opening my website using IE 11, while I'm trying to resolve a problem in my code.
Or if you maybe have an idea to resolve my problem please write to my inbox here on stackoverflow. (IE 11 is killing me...)
as you can see the problem is when you are opening It on IE it makes the images full size, and the console in ie is not helping that much for me.
Code
Html
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<title>News | Designplace</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href="CSS/Navigation.css" rel="stylesheet" type="text/css">
<link href="CSS/Content.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="NavScript.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<body>
<div class="sidenav" id="mySidenav">
<!--NAv-->
</div>
<div class="sidenav_small" id="mySidenav_small">
</div>
<div class="sidenav_icon" id="mySidenav_icon">
☰
</div>
<div class="latest">
<h2 class="latest_news">Latest News</h2>
<h4 class="more">More...</h4>
<div class="table">
<div class="tr">
<div class="td">
<a class="img_link" href="/art/news/00004/Review-af-macos-Mojave-public-beta.html">
<img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="macOS">
<div class="inner">
<h3>Review af macOS Mojave beta: God men ikke perfekt.
</h3>
</div>
</a>
</div>
<div class="th"></div>
<div class="td">
<a class="img_link" href="/art/news/00002/206-400-danskere-har-downloadet-ny-nemid-app-i-foerste-doegn-efter-lancering.html">
<img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="NemID">
<div class="inner">
<h3>206.400 danskere har downloadet ny NemID-app i første døgn efter lancering.
</h3>
</div>
</a>
</div>
<div class="th"></div>
<div class="td">
<a class="img_link" href="/art/news/00001/hands-on-nokias-spritnye-foraarskollektion-viser-at-billige-smartphones-ikke-behoever-at-vaere-tarvelige.html">
<img src="https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg" alt="Nokia telefon">
<div class="inner">
<h3>Hands-on: Nokias spritnye forårskollektion viser, at billige smartphones ikke behøver at være tarvelige.
</h3>
</div>
</a>
</div>
</div>
</div>
</body>
</head>
</html>
CSS
#charset "UTF-8";
html, body {
height: 100%;
}
.object {
height: 100%;
width: 100%;
}
.table {
display: table;
width: 100%;
}
.tr {
display: table-row;
}
.td {
display: table-cell;
/*border: 1px solid #ccc;*/
padding: 2px;
width: 31.1%
}
#media screen and (max-width: 400px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 40px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
font-size: 14px;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
text-decoration: none;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 401px) and (max-width:600px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
th {
width: 423px;
height: 273px;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 50px;
text-align: center;
margin: -10px;
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
font-size: 18px;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 601px) and (max-width: 720px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
th {
width: 423px;
height: 273px;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 70px;
text-align: center;
margin: -10px;
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
font-size: 24px;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width:720px) and
(max-width:750px) {
body {
background-color: #596770;
margin-left: 0px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:29%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 750px) and (max-width: 1280px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.th {
width: 20px;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:20%;
margin-right: 20px;
}
.teaser {
font-size:70%;
min-height: 50%;
padding: 5px 0px 0px 0px
}
.infoline {
font-size: 70%;
color:white;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 1281px) and (max-width: 1440px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:29%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width: 1441px) and (max-width:1920px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.latest_news {
width: 300px;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
margin-top: 5px;
font-size: 13px;
min-height: 25%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:22%;
margin-right: 20px;
}
.infoline {
font-size: 12px;
}
.article_img {
width: 100%;
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width:1921px) and (max-width:2160px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.latest_news {
width: 300px;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:19.5%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%;
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
#media screen and (min-width:2160px) and (max-width:3840px) {
body {
background-color: #596770;
margin-left: 85px; /* Same as the width of the sidenav */
margin-top: 102.5px;
font-size: 18px; /* Increased text to enable scrolling */
padding: 0px 52px 0px 52px;
/*font-size: 35;*/
color:white;
font-family: montserrat, sans-serif;
}
.latest img {
max-width: 100%;
}
.About {
margin: -45px -52px 0px -52px;
}
.warning {
font-size: 80px;
text-align: center;
margin: -10px
}
.about-line {
margin: 30px;
}
.experimental {
text-align: center;
}
.td {
position: relative;
color: white;
}
/* Bottom left text */
.inner {
position: absolute;
font-size: 14px;
bottom: 15px;
left: 30px;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.img_link {
color: white;
text-decoration: none;
}
.latest_news {
width: 300px;
}
.more {
float: right;
margin-top: -45px;
color:white;
}
.more:hover {
text-decoration: underline;
}
td {
padding: 5px 8px 5px;
}
table {
width:100%;
}
thead {
display: none;
}
tr:nth-of-type(2n) {
background-color: inherit;
}
tr td:first-child {
/*background: #f0f0f0;*/
font-weight:normal;
font-size:1.3em;
}
tbody td {
display: block;
text-align:left;
}
tbody td:before {
content: attr(data-th);
display: block;
text-align:left;
font-weight: normal;
}
tbody td::before {
content: attr(data-th);
display: none;
}
.img {
width: 100%;
}
.content {
width: 400px;
overflow: hidden;
}
.teaser {
font-size: 13px;
min-height: 50%;
}
.columnrow {
padding: 10px 0px 10px 0px;
display:flex;
}
.contentimage {
Float:left;
width:11%;
margin-right: 20px;
}
.infoline {
font-size: 13px;
}
.article_img {
width: 100%;
}
.article {
margin: 0% 15%;
}
.article_infoline {
font-size: 12px;
}
.article_teaser {
font-size: 18px;
margin-bottom: 10px;
}
.article_title {
margin-bottom: 3px;
}
.article_line {
margin: 30px 0px;
}
.article_image_text {
font-size: 14px;
margin-top: 0px;
}
}
EDIT:
I changed the code from .Img to .Img_link > Img and that worked but if someone has an idea to get var isIE11 = !!window.MSInputMethodContext && !!document.documentMode; working with an whole javascript, I will be happy, im not that good with javascript yet.
i've tried:
function IncompatibleBrowser() {
var x = document.getElementById("simpleModal")
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if (true) {
x.className += " Incompatible";
} else {
x.className = "Compatible"
}
}
EDIT 2:
Okay the code that Zani gave worked kinda. the console in our browsers only detects the code in IE11, just a I wanted. but the code gave an error:
Script 5007: Unable to get property 'style' of undefined or null reference
This is the code that Zani gave.
<script type="text/javascript">
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if(isIE11)
document.getElementById("IDOfYourElement").style.display="block";
</script>
There is no problem with IE. The problem is in your code.
Please find all .img {width:100%} in your enormous CSS and replace them with
img {width:100%} (without a dot).
You can target IE11 with browser sniffing. This comes with its own downsides, as you might know.
In my experience IE11 is not that bad (compared to IE8 or Safari). So there is a good chance that your issue or set of issues can be handled.
Please ask a more specific question.
<script type="text/javascript">
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if(isIE11)
document.getElementById("IDOfYourElement").style.display="block";
</script>
Please first search before ask question.
Internet Explorer 11 detection
i'm redesigning my website. and doing that i'm finding myself in some problems using the css code i wrote.
i use div's to get an image and some text next to each other.
i'm unable to get the text moved to the correct place (see pictures) the margin-left doesn't seem to work when it is in the css file but it works when directly embedded in the div tags, am i doing something wrong?
also i'dd like to add that i don't need to set the image size in the html code but its in the css code is this possible?
What i get
What i want
body
{
background:#333 url(bg.jpg) repeat top left;
font-family:Arial;
color:white;
text-align:center;
}
body header.heading
{
width:1150px;
/*background:transparent url(../images/menu/MEbanner.jpg) no-repeat top;
background-size: 1150 100px;
padding-top:101px;*/
margin:0 auto;
z-index:0;
}
body.Content
{
width:1150px;
}
main
{
width:1150px;
margin: 0 auto;
}
section
{
text-align:left;
margin:0 auto;
}
header nav
{
width:1150px;
background:transparent url(../images/menu/MEbanner.jpg) no-repeat top;
background-size: 1150 100px;
padding-top:101px;
margin:0 auto;
z-index:0;
}
header nav ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
header nav li {
float: left;
border-right: 1px solid #bbb;
}
header nav li:last-child {
border-right: none;
}
/*header nav li a {
display: block;
color: white;
text-align: center;
padding: 20px 16px;
text-decoration: none;
}*/
/* Change the link color to #111 (black) on hover */
header nav li a:hover {
background-color: #111;
}
header nav li.active {
background-color: #4CAF50;
}
header nav li a, .dropbtn {
display: inline-block;
color: white;
text-align: center;
padding: 20px 16px;
text-decoration: none;
}
header nav li a:hover, .dropdown:hover .dropbtn {
background-color: #111;
}
header nav li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
display: block;
}
nav
{
text-align:left;
margin:0 auto;
}
.hidden {display:none}
hr
{
border-left: none;
border-right: none;
height:4px;
margin: 2em 0 2em 0;
}
main a:link {color:#fff;} /* unvisited link */
main a:visited {color:#fff;} /* visited link */
main a:hover {color:#159;} /* mouse over link */
blockquote{
color:white;
border-left: 8px solid;
border-color: #0BD676;/*#0DFF8C;*/
padding-left:10px;
}
h2
{
font-size: 30px;
color:Black;
}
h1,h2,h3,h4
{
font-family: 'Open Sans Condensed', sans-serif;
color:#4CAF50;
text-decoration:underline;
}
h2, h3
{
font-size: 1.6em;
letter-spacing: -1px;
margin: 0 0 0.75em 0;
}
h3
{
font-size:1.3em;
}
h1
{
font:bold;
}
h4
{
font-size:1em;
margin: 0.5em 0 0.5em;
padding-left:1em;
}
.green
{
border-left: 8px solid;
border-color: #0BD676;/*#0DFF8C;*/
padding-left:10px;
color: #4CAF50;
margin-left:40px;
font-style:oblique;
}
article.centeralign
{
text-align:center;
}
div.wrapper{
width: 800px;
overflow: hidden;
}
div.toolsWrapper{
width: 980px;
overflow: hidden;
}
div.left{
width: 200px;
float:left;
margin-right:40px;
padding-left:40px;
}
div.right{
float:left;
margin-left: 20px;
}
div.cc
{
width:200px;
text-align:right;
font-size:10px;
}
div.ccf
{
text-align:center;
font-size:12px;
}
iframe
{
text-align:center;
float:center;
}
/* ===========================
====== Contact Form =======
=========================== */
input, textarea {
padding: 10px;
border: 1px solid #E5E5E5;
width: 200px;
color: #999999;
box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
-webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;
}
textarea {
width: 400px;
height: 150px;
max-width: 400px;
line-height: 18px;
}
input:hover, textarea:hover,
input:focus, textarea:focus {
border-color: 1px solid #C9C9C9;
box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px;
}
.form label {
margin-left: 10px;
color: #999999;
}
/* ===========================
====== Submit Button ======
=========================== */
.submit input {
width: 100px;
height: 40px;
background-color: #474E69;
color: #FFF;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
table, th, td {
border: 1px solid black;
border-color:white;
}
th, td {
padding: 15px;
}
.blue{
background: url(blue.png) no-repeat left center;
color: #109CEF;
padding: 0px 40px 0px 20px;
font-style:oblique;
}
.red{
background: url(red.png) no-repeat left center;
color:#FF0000;
padding: 0px 40px 0px 20px;
font-style:oblique;
}
<article>
<h1>Audio Projects</h1>
<blockquote>
<h3>
<a href="Damp">
Class D Amplifier
</a>
</h3>
<div class="wrapper">
<div class="left">
<img src="Damp/Damp_front.JPG"/>
</div>
<div class="right">
Some text that should be next to image
</div>
</div>
</blockquote>
</article>
I changed those:
.h1 {
text-align: left;
}
.h3 {
text-align: left;
}
div.left{
float: left;
}
div.right {
width: 500px;
float: left;
margin-left: 20px;}
results
https://i.stack.imgur.com/7rswY.png
You just need to change a few styles, and replace the <article> with a <div> (For IE support)
div.wrapper {
width: 800px;
overflow: hidden;
}
div.toolsWrapper {
width: 980px;
overflow: hidden;
}
div.left {
width: 200px;
float: left;
margin-right: 40px;
padding-left: 40px;
}
div.right {
color: white;
display: inline-block;
position: absolute;
top: 0;
}
.wrapper {
position: relative;
width: 50%;
}
.title {
color: #4B9F49;
}
.inner_title {
color: white;
}
.blockquote {
border-left: 3px solid #0CD673;
padding-left: 5px;
}
#article {
background: black;
}
<div id="article">
<h3>
Audio Projects
</h3>
<blockquote class="blockquote">
<h3>
Class D Amplifier
</h3>
<div class="wrapper">
<img src="Damp/Damp_front.JPG" style="height:80px; width:200px;"/>
<div class="right">
Some text that is now next to the image.
</div>
</div>
</blockquote>
</div>
I guess problem is with width of left class division. Try to make it auto.
div.left{
width: auto;
....
}
Option 1, my preferred way of doing this:
Remove the float in .left take the inline left margin out of the .right and give both .left and .right
display: inline-block;
Giving you
div.left{
width: 200px;
/*float:left;*/
display: inline-block;
margin-right:40px;
padding-left:40px;
}
div.right{
display: inline-block;
width: 520px;
margin-left: 20px;
}
For those two classes
Option 2:
Give both a float:left
div.left{
width: 200px;
float:left;
margin-right:40px;
padding-left:40px;
}
div.right{
float:left;
width: 520px;
margin-left: 20px;
}
This should cause them to stack in the same way that inline-block does, but floats can cause trouble later. In either case you have to limit the width on .right or the text will prefer to be full width and not be inline, but rather be below the image. The total width of the two divs has to be less than the available width in .wrapper
Your image is probably larger than the .left container (given that this is the only element that is not included in your snippet to test properly).
Try the following ...
img{
height: auto;
width: auto;
max-height: 100%;
max-width: 100%;
}
... you should probably add a class for that image, rather than styling all images this way.
well, what i can advice you is to put the text in the same division as the image like in paragraph tag and then give the image css attribute called "float:left" according to what you want.
thank you
hope this is going to help you
use .classname only
instead of div.classname
Notice how the page is centered in the middle. How can I make it expand to fit the screen, including the columns? Sorry, I'm brand new to coding. I included most of the code because I have no idea where to find it. Hopefully one of you can help. I'm assuming it must be on body or on the home page?
/* Base styles */
*, input[type=search] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
background-color: $color_2;
}
body {
color: $color_4;
font-family: $font_1;
font-size: 13px;
font-weight: lighter;
line-height: 1.5;
margin: 0;
margin-left: 0px;
padding-bottom: 100px;
}
img {
max-width: 100%;
vertical-align: middle;
}
img[width], img[height] {
max-width: none;
}
figure > img {
display: block;
}
a {
color: $color_5;
font-family: $font_2;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
ul, ol {
list-style: none;
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
text-align: left;
width: 100%;
}
[dir="rtl"] table {
text-align: right;
}
td, th {
border-color: #eeeeee;
border-style: solid;
padding: 18px;
}
th {
border-width: 1px 0;
color: #bebebe;
font-size: 11px;
font-weight: normal;
white-space: nowrap;
}
td {
border-width: 0 0 1px 0;
}
h1, h2, h3, h4, h5, h6 {
color: black;
font-weight: 400;
}
h1 {
font-size: 20px;
}
input, label {
display: inline-block;
vertical-align: middle;
}
label {
font-size: 12px;
}
input[type="checkbox"] + label {
margin-left: 5px;
}
input, textarea {
border: 1px solid #dddddd;
border-radius: 2px;
padding: 10px;
}
textarea {
height: 100px;
padding: 7px 10px;
resize: vertical;
}
textarea, input[type=text] {
width: 100%;
}
input, textarea, select {
color: #555;
}
input::-ms-clear {
display: none;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
margin: 0;
-webkit-appearance: none;
}
::-webkit-input-placeholder {
color: #cccccc;
}
:-ms-input-placeholder {
color: #cccccc;
}
::-moz-placeholder {
color: #cccccc;
}
/* Buttons */
button, [role=button], [type=button], [type=submit] {
border-radius: 4px;
border: 1px solid #dddddd;
color: $color_5;
cursor: pointer;
display: inline-block;
padding: 5px 10px;
position: relative;
vertical-align: middle;
white-space: nowrap;
}
a[role=button]:hover {
text-decoration: none;
}
input[type=submit] {
background: #444;
border-color: transparent;
color: #FFF;
padding: 10px 30px;
}
input[type=submit][disabled] {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
/* IE 8 */
opacity: 0.4;
}
button img, [role=button] img {
border-radius: 4px;
margin: 0 5px 0 0;
height: 20px;
position: relative;
top: -1px;
vertical-align: middle;
}
[dir="rtl"] button img, [dir="rtl"] [role=button] img {
margin: 0 0 0 5px;
}
/* Forms */
.form {
max-width: 505px;
}
.form-field + .form-field {
margin-top: 25px;
}
.form-field label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
.form-field input[type=checkbox] + label {
margin: 0 0 0 10px;
}
.form-field.required > label:after {
content: "*";
color: red;
margin-left: 2px;
}
.form-field p {
color: #bebebe;
font-size: 11px;
}
.form-field input[type=number], .form-field input.datepicker {
width: 150px;
}
.form form + form, .searchbox {
margin-top: 25px;
}
.searchbox-suggestions {
background-color: #fff;
border: 1px solid #eeeeee;
border-radius: 4px;
padding: 10px 20px;
}
.searchbox-suggestions li {
padding: 5px 0;
}
[data-loading="true"] input,
[data-loading="true"] textarea {
background: transparent url(/hc/assets/loader.gif) 99% 50% no-repeat;
background-size: 16px 16px;
}
.form footer {
border-top: 1px solid #eeeeee;
margin-top: 40px;
padding-top: 30px;
text-align: right;
}
.form footer a {
color: #cccccc;
cursor: pointer;
margin-right: 15px;
}
/* Navigation menus */
.nav li, .nav-bordered li, .nav-spaced li {
display: inline-block;
font-weight: bold;
}
.nav li a, .nav-bordered li a, .nav-spaced li a {
font-weight: normal;
}
.nav-bordered li + li {
border-color: #eeeeee;
border-style: solid;
border-width: 0 0 0 1px;
margin: 0 0 0 30px;
padding: 0 0 0 30px;
}
[dir="rtl"] .nav-bordered li + li {
border-width: 0 1px 0 0;
margin: 0 30px 0 0;
padding: 0 30px 0 0;
}
.nav-spaced li + li {
margin: 0 0 0 40px;
}
[dir=rtl] .nav-spaced li + li {
margin: 0 40px 0 0;
}
/* Search box */
.search-box, .sub-nav .search {
position: relative;
}
.search-box:before, .sub-nav .search:before {
content: "\1F50D";
font-family: "entypo";
font-size: 1.25em;
line-height: 0;
position: absolute;
text-align: center;
top: 50%;
width: 2.5em;
z-index: 1;
}
.search-box input, .sub-nav .search input {
line-height: 1.2em;
font-weight: lighter;
padding: .75em 2.7em;
width: 100%;
-webkit-appearance: none;
}
.search-box input[type="submit"], .sub-nav .search input[type="submit"] {
display: none;
}
/* Breadcrumbs */
.breadcrumbs li {
color: #bebebe;
display: inline-block;
font-size: 12px;
}
.breadcrumbs li + li:before {
content: ">";
margin: 0 4px;
}
.breadcrumbs li a {
color: $color_4;
}
/* Labels */
.label, .request-status {
border-radius: 20px;
display: inline-block;
font-size: 10px;
padding: 3px 10px;
text-transform: uppercase;
white-space: nowrap;
}
/* Metadata */
.meta, .meta-group {
color: #cccccc;
display: inline-block;
font-size: 11px;
}
.meta-group * + *:before {
content: "\2022";
font-size: 8px;
margin: 0 10px;
}
/* Helper classes */
.clearfix:before, .clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
/* Social share links */
.share {
white-space: nowrap;
}
.share li, .share a {
display: inline-block;
}
.share a {
height: 30px;
line-height: 30px;
overflow: hidden;
vertical-align: middle;
width: 30px;
}
.share a:before {
background: #CCC;
border-radius: 50%;
color: #FFF;
display: inline-block;
font-family: "entypo";
text-align: center;
width: 100%;
}
.share a:hover {
text-decoration: none;
}
.share-twitter:before {
content: "\F309";
}
.share-facebook:before {
content: "\F30C";
}
.share-linkedin:before {
content: "\F318";
}
.share-googleplus:before {
content: "\F30F";
}
/* Pagination */
.pagination {
margin: 20px 0;
text-align: center;
}
.pagination * {
display: inline-block;
}
.pagination li {
border: 1px solid #eeeeee;
float: left;
margin-left: -1px;
}
[dir="rtl"] .pagination li {
float: right;
}
.pagination a, .pagination span {
color: inherit;
font-size: 12px;
padding: 5px 12px;
}
.pagination-current {
background-color: #f9f9f9;
color: #bebebe;
}
.pagination-first {
border-radius: 3px 0 0 3px;
}
[dir="rtl"] .pagination-first {
border-radius: 0 3px 3px 0;
}
.pagination-last {
border-radius: 0 3px 3px 0;
}
[dir="rtl"] .pagination-last {
border-radius: 3px 0 0 3px;
}
/* Markdown styles */
.markdown {
word-wrap: break-word;
line-height: 1.7;
}
.markdown img {
max-width: 70%;
}
.markdown hr {
background-color: #eeeeee;
border: 0;
height: 1px;
}
.markdown ul, .markdown ol {
list-style-position: inside;
padding: 0 15px;
}
.markdown ul {
list-style-type: disc;
}
.markdown ol {
list-style-type: decimal;
}
.markdown pre {
background: #f9f9f9;
border: 1px solid #eeeeee;
border-radius: 3px;
padding: 10px 15px;
overflow: auto;
white-space: pre;
}
.markdown blockquote {
border-left: 1px solid #eeeeee;
color: #bebebe;
font-style: italic;
padding: 0 15px;
}
/* Frame */
main, .header-inner, .footer-inner {
margin: 0 auto;
padding: 20 20px;
width: 500px;
}
/* Columns */
.main-column, .side-column {
display: inline-block;
vertical-align: top;
}
.main-column {
width: 620px;
}
.side-column {
width: 270px;
margin-left: 45px;
}
[dir=rtl] .side-column {
margin-left: 0;
margin-right: 45px;
}
/* Header */
.header {
background: $color_1;
border-bottom: 1px solid #eeeeee;
}
.header-inner {
display: table;
height: 100px;
}
.logo, .user-nav {
display: table-cell;
vertical-align: middle;
}
.logoHD, .user-navHD {
display: table-cell;
position: left;
left: 80px;
vertical-align: middle;
}
.logo img {
max-height: 60px;
}
.logoHD img {
max-height: 60px;
}
.user-nav {
text-align: right;
}
.user-navHD {
left: center;
}
.user-nav > * {
display: inline-block;
margin: 0 0 0 25px;
}
.user-navHD > * {
display: inline-block;
margin: 0 0 0 25px;
}
[dir=rtl] .user-nav {
text-align: left;
}
[dir=rtl] .user-nav > * {
margin: 0 25px 0 0;
}
/* Home page */
.hero-unit {
display: block;
font-size: 22px;
padding: 80px 60px;
}
body.community-enabled .knowledge-base, body.community-enabled .community {
display: inline-block;
vertical-align: top;
}
body.community-enabled .knowledge-base {
width: 620px;
}
.knowledge-base, .community {
display: inline-block;
vertical-align: top;
}
.knowledge-base {
width: 100%;
}
Change
.side-column {
width: 270px;
margin-left: 45px;
}
.main-column {
width: 620px;
}
To
.side-column {
width: 0px;
margin-left: 0px;
}
.main-column {
width: 100%;
}
You have to either use percentages or use something like media queries to set certain widths of the content. An example of percentages would be:
main, .header-inner, .footer-inner {
margin: 0 auto;
width: 90%;
}
You have main set to 500px width. You need to remove that width style. Then main will take up the full width of it's parent container which is the body.
The principle behind this is that a block-level element takes up the full width of it's parent container by default. Since main is a block-level element you don't have to set 100%; it defaults to 100% automatically.
As an aside, your padding style for main is malformed. You have padding: 20 20px; you need to use units, not just numbers. So either write padding: 20px 20px; or even better just padding: 20px;
It looks like you're using fixed sizes in your CSS. For example, the lines below:
.main-column {
width: 620px;
}
.side-column {
width: 270px;
margin-left: 45px;
}
are assigning fixed width values. (By fixed, I mean using units like px, mm, in). Rather, it'd be appropriate to use relative sizes (i.e., percents usually). For larger, containing elements, I tend to use units of vw (viewport width) and vh (viewport height). Doing likewise in your CSS where appropriate should help. Also this makes it easier to optimize for other device sizes should you choose to use CSS media queries later.
I have problem aligning three boxes to the center of section.
Here is what I have so far:
/*==============Custome Css ====================*/
.slider_patch {
background: rgba(63, 61, 61, 0.61);
padding: 0px 15px;
box-shadow: 1px 1px 28px #2F2F2F;
}
button.small.skyblue a {
color: #fff;
}
/*==============Custome Css ====================*/
/* #Misc
================================================== */
/* EXTRAS */
.brdr-r1, .brdr-r2 { border-right: 1px solid #e5e5e5; padding-right: 19px; }
.brdr-l1, .brdr-l2 { border-left: 1px solid #e5e5e5; padding-left: 19px; }
.brdr-r2 { padding-right: 27px; }
.brdr-l2 { padding-left: 27px; }
.pad-r27 { padding-right: 27px; }
.pad-l27 { padding-left: 27px; }
.alignright { text-align: right; }
img.alignright { float: right; }
.alignleft { text-align: left; }
img.alignleft { float: left; }
.aligncenter { text-align: center; }
.wp-caption { display: block; color: #444; }
.wp-caption-text { font-size: 15px; }
.sticky { color: #555; }
.gallery-caption { display: inline; }
.bypostauthor { font-size: 13px; }
.moonicons-box1 { font-size: 16px; display: inline-block; width: 15em; padding: .25em .5em; background: #fff; margin: .5em 1em .5em 0; border: 1px solid #e8e8e8; }
.alignright { text-align: right; }
img.alignright { float: right; }
.alignleft { text-align: left; }
img.alignleft { float: left; }
.aligncenter { text-align: center; }
.wp-caption { display: block; color: #444; }
.wp-caption-text { font-size: 15px; }
.sticky { color: #555; }
.gallery-caption { display: inline; }
.bypostauthor { font-size: 13px; }
/* Scroll to top */
#scroll-top a { width: 16px; height: 16px; padding: 6px 8px 9px; border-radius: 4px; background: #818c90; position: fixed; bottom: 48px; right: 32px; display: none; opacity: 0.89; filter: alpha(opacity=89); z-index: 499841; }
#scroll-top a i { font-size: 16px; color: #fff; display:block; }
#scroll-top a:hover { background-color: #ffcc00; cursor: pointer; }
h1.pnf404 { font-size: 176px; line-height: 1.1; font-weight:900;}
h2.pnf404 { font-size: 42px; line-height: 1.2; font-weight:700; }
input.txbx404 { float:left; margin-top:2px; margin-right:4px; padding:7px 4px; min-height:inherit; border-radius:3px; }
input.btn404 { float:left; margin:1px; padding:8px 12px 9px; }
.v-shadow-l { background:url(../images/v-shadow-left.png) no-repeat right center; }
.v-shadow-r { background:url(../images/v-shadow-right.png) no-repeat left center; }
.v-shadow-r, .v-shadow-l { min-height:320px; }
.pad-r10 { padding-right:10px; }
.pad-r20 { padding-right:20px; }
.pad-r30 { padding-right:30px; }
.pad-r40 { padding-right:40px; }
.pad-l10 { padding-left:10px; }
.pad-l20 { padding-left:20px; }
.pad-l30 { padding-left:30px; }
.pad-l40 { padding-left:40px; }
/* #Column Shortcodes
----------- */
.one_half, .one_third, .two_third, .three_fourth, .one_fourth, .one_fifth, .two_fifth { margin-right: 3%; float: left; margin-bottom:2px; }
.one_half { width: 48%; }
.one_third { width: 30.6666%; }
.two_third { width: 65.3332%; }
.one_fourth { width: 22%; }
.three_fourth { width: 74%; }
.one_fifth { width: 16.8%; }
.two_fifth { width: 37.6%; }
.column-last { margin-right: 0 !important; clear: right; }
.easyPieChart { position: relative; text-align: center; }
.easyPieChart canvas { position: absolute; top: 0; left: 0; }
.pie { text-align:center; font-size:49px; position:relative; margin:0 auto 20px; }
.pie p { font-size:16px; color:#888; font-weight:400; position:absolute; bottom:-52px; width:100%; padding-top:10px; border-top:2px solid #f9f9f9;}
.container .pie p { margin-bottom:0;}
/* #Media Queries
================================================== */
/* Smaller than standard 960 (devices and browsers) */
#media only screen and (max-width: 959px) {
.img-box { width: 256px; height: 188px; }
.last-project .img-box { background: #EA3C3C; }
.last-project .img-box:nth-child(even) { background: #F66060; }
.ab-box { height: 235px; }
.author-detail { width: 218px; }
.comment-contents { width: 343px; }
.child-comment .comment-contents { width: 263px; }
.contact input { width: 330px; float: none; }
.contact textarea { width: 486px; }
.row.magic, .s-qoute-man { padding: 0; margin-bottom: 10px; }
a.get { margin-bottom: 14px; }
.pad-r10, .pad-r20, .pad-r30, .pad-r40 { padding-right: 5px; }
.pad-l10, .pad-l20, .pad-l30, .pad-l40 { padding-left: 5px; }
#main-content-pin .container { width: auto; }
}
/* Tablet Portrait size to standard 960 (devices and browsers) */
#media only screen and (min-width: 768px) and (max-width: 959px) {
#boxed-wrap { width: 828px; }
.social-icons a { margin: 1px 4px 0 4px; }
.row.magic { padding-left: 20px; margin-bottom: 10px; }
#tline-content { width: 800px; }
.tline-box { width: 335px; }
/*#nav a span, #nav a:after { font-size:9px; }*/
.blog-date-sec { width: 42px; height: 42px; }
.help-box { width: 50%; }
}
/* All Mobile Sizes (devices and browser) */
#media only screen and (max-width: 767px) {
.sidebar, .rgt-cntt, .sidebar.leftside { padding-right:0; background:none; padding-top:40px; margin-top:40px; border-top:5px solid #e5e5e5;}
.rgt-cntt, .sidebar.leftside { padding-top:0px; margin-top:0px; border-top:0 none;}
.contact-form .txbx { width:224px;}
.pricing-table .plans-f-list.respo { display:inline; visibility:visible;}
#header.super-fixed { height:auto; box-shadow:none; border-bottom:4px solid #f0f0f0;}
#headline { height:auto; border-bottom:3px solid #f3f3f3; padding:14px 0; }
#headline h3 { border-top-color:#f6f6f6; font-size:37px; text-align:center;}
#headline h3 small { display:block; margin-top:14px; margin-bottom:0; font-size:16px; letter-spacing:0; font-weight:400; }
.servobx, .servobx div, .servobx img, ul#main-ibox li, ul#main-ibox li.active9 { width:100%; float:none;}
#search-form { display:none; }
#header .alignright, top-inf.alignright { text-align:center;}
#search-form2 { display:block; }
#side-content { padding-bottom:30px; border-bottom:5px solid #f3f3f3; margin-bottom:40px;}
.top-bar { height:65px; padding:5px 0 6px; background:url(../images/topsobg1.png) repeat-x center center; white-space:nowrap; overflow:hidden;}
.top-bar h6 { font-size:11px; letter-spacing:0; margin:0 10px 0 0;}
.top-bar h6 i { font-size:12px; width: 12px; height: 12px; text-align: center; padding:3px; margin-right:3px; }
.top-bar .socailfollow, .top-links, .top-links.rgtflot, .top-bar .socailfollow.lftflot { float:none; text-align:center; clear:both; min-height:22px;}
.top-bar .socailfollow, .top-bar .socailfollow.lftflot { padding-top:8px;}
.top-bar .socailfollow a, .top-bar .socailfollow.lftflot a, .top-links p, .top-links img { float:none; display:inline; padding-top:10px; background:none;}
.top-links, .top-links.rgtflot { margin:0 0 8px 0; padding-top:4px; }
.top-links.rgtflot { margin-top:12px; margin-bottom:6px;}
.container hr { margin-left:0; margin-right:0;}
.blog-date-sec { border:0 none; margin:0; text-align:left; border-bottom:1px solid #e5e5e5; background:#fdfdfd;}
.blog-post { border-bottom-width:3px;}
.nav-search { float: none; margin: 0; }
.img-box { width: 420px; height: 308px; }
.comment-contents { width: 328px; margin-right: 0; }
.child-comment .comment-contents { width: 248px; }
.contact textarea { width: 398px; }
.author-detail { margin: 20px 0; }
.blog-date-sec { width: auto; display:block; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; border: none; border-bottom: 2px solid #e3e3e3; margin-bottom: 5px; }
.blog-date-sec span, .blog-date-sec h3 { display: inline; margin: 0 10px; line-height: 50px; }
.blog-date-sec span { font-size: 20px; font-weight: 300; }
.blog-date-sec h3 { font-size: 32px;}
.contact-form .txbx { width: 224px; }
.pricing-table .plans-f-list.respo { display: inline; visibility: visible; }
#headline h3 { border-top-color: #f6f6f6; }
.image-gallery ul li, .image-gallery ul li img { display:block; width:auto; max-width:100%; height:auto; float:none;}
input[type="text"].header-saerch, input[type="text"].header-saerch:focus { width: 261px; margin-top: 10px; }
.logo { text-align: center; }
.pin-box { width: 256px; }
.tline-box .blog-date-sp { width: 80%; }
.tline-box .blog-com-sp { width: 0; display: none; }
.tabs-left > .nav-tabs, .tabs-left > .nav-tabs > li > a, .nav-tabs > li, .nav-tabs > li.active, .tabs-left > .nav-tabs > li.active > a, .tabs-left > .nav-tabs .active > a:hover { width:100%; display:block; padding-left:0; padding-right:0; }
.tabs-left > .nav-tabs > li > a { border-right:0 none;}
.tabs-left > .tab-content { border:0 none;}
.tab-content .columns, .tab-content .column { margin:0 10px; max-width:90%; }
.date-sp-wrap { margin: 0; float: right; margin-bottom: 7px; }
.blog-line .blog-date-sec { height: auto; }
.v-shadow-r, .v-shadow-l { min-height: inherit; background: none; }
.pad-r10, .pad-r20, .pad-r30, .pad-r40, .pad-l10, .pad-l20, .pad-l30, .pad-l40 { padding: 0; }
.one_half, .one_third, .two_third, .three_fourth, .one_fourth, .one_fifth, .two_fifth { width: 100%; float: none; margin-right: 0; }
.latest-f-blog, .qot-week { margin:0;}
.callout { margin:10px 0px 20px; }
.brdr-l1, brdr-r1 { padding:0; border:0 none; }
.brdr-l1 { margin-top:30px;}
.tab-content p, .tab-content li { font-size: 12px; }
.help-box { width: 100%; }
.ab-box { height: auto; padding-bottom: 25px; }
input[type="text"].header-saerch, input[type="text"].header-saerch:focus { float: none; display: inline; position: relative; z-index: 10000; }
.jcarousel-next, .jcarousel-prev { padding:12px; }
.jcarousel-prev { right:38px;}
.jcarousel-next:after, .jcarousel-prev:after { top:13px; right:13px;}
.our-clients-wrap .jcarousel-next, .our-clients-wrap .jcarousel-prev { padding:10px;}
.is-sticky, .is-sticky #header { position:relative; height:auto;}
.is-sticky #header { margin-top:0;}
.is-sticky .logo { height:auto; margin-top:0; }
.is-sticky .logo img { max-height:auto; height:auto; }
}
/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
#media only screen and (min-width: 480px) and (max-width: 767px) {
.help-block { height: auto; }
#boxed-wrap { width: 460px; }
.page-subtitle { left: 0; padding: 10px 0 0 20px; bottom: 0; border-bottom: 1px solid #e8edee; margin-bottom: 20px; height: auto; width: auto; clear: both; background: #fdfdfd; border-radius: 0; }
.contact-form .txbx { width: 338px; }
.pricing-table .plans-f-list.respo { display: inline; visibility: visible; }
.jcarousel-item, .last-project .portfolio-item { max-width: 210px; height: 157px; float: left; }
.pin-box { width: 166px; width: 164px\9; }
#tline-content { width: 460px; }
.tline-box { width: 165px; }
}
/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
#media only screen and (max-width: 479px) {
.nav-wrap2.mn4 #nav a { padding: 15px 4px; }
#menu a { padding: 15px 4px; }
.img-box { width: 300px; height: 220px; }
.author-detail { width: 254px; }
.author-arrow { width: 11px; height: 6px; background: url('../images/testimonial-arrow-top.png') no-repeat; left: 25px; top: -6px; }
.contact input { width: 288px; margin-right: 0; }
.contact textarea { width: 278px; }
#boxed-wrap { width: 340px; }
.footbot { min-height: 38px; height: auto; }
.page-subtitle { left: 0; padding: 10px 0 0 20px; bottom: 0; border-bottom: 1px solid #e8edee; margin-bottom: 20px; height: auto; width: auto; clear: both; background: #fdfdfd; border-radius: 0; }
.pricing-table .plans-f-list.respo { display: inline; visibility: visible; }
.pricing-table ul { width: 136px; }
.pricing-table ul li { width: 124px; padding: 5px; }
.pricing-table ul li.plan-header, .pricing-table ul li .plan-title, .pricing-table ul li .plan-price { max-width: 136px; }
.pricing-table ul li.plan-footer { max-width: 114px; }
.portfolio-item { margin-bottom: 14px; }
.commentin { width: 92%; }
#tline-content { width: 300px; }
.tline-box { width: 250px; }
.tline-row-l, .tline-row-r { display: none }
.tline-box.rgtline { float: left; left: 0; }
}
#media only screen and (min-width: 1200px) {
#boxed-wrap { width:1180px;}
.white-space { height:110px;}
h4.subtitle { margin:39px 0 21px 0; }
#main-content-pin .container { padding:0 40px; }
.sidebar.leftside { background-position: 295px; padding-right:70px; }
.blog-date-sec h3 { font-size:36px;}
}
#media screen and (min-width: 767px) {
/* ensure #nav is visible on desktop version */
#nav { display: block !important; }
.ls-layer h1, .ls-layer h3 { left:10px;}
}
button.small.skyblue.demooo {
width: 65%;
/*border-bottom: 6px solid rgb(0, 150, 192);*/
}
li.color {
background-color: rgb(197, 197, 197);
padding: 4px;
}
section.container.first-block.aligncenter.colorbar {
/*background: rgb(0, 173, 239);*/
/* width: 100%; */
/* left: 10px; */
padding: 0px 38px 0px 38px;
}
h4.slight.frontsight {
color: #333;
}
figure.shop-item.one_fourth.boxwrap {
background: white;
margin-bottom:35px;
border-radius: 4px;
box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.42);
/*margin-right:10px;
width: 17%;*/
/* padding: 6px; */
/* left: 99px; */
/* color: black; */
/* padding: 0px; */
/* top: 18px; */
}
h4.fronttext {
font-size: 15px;
line-height: 24px;
/* color: black !important; */
}
figure.shop-item.one_fourth.boxwrap:hover {
background: rgba(239, 239, 239, 1);
/* color: white; */
}
/* --------Custom CSS-------------*/
table {
width:100%;
}
table tr{
height:20px;
}
table tr td p{
margin-bottom:0px;
}
tr:nth-child(even) {
background-color: rgb(166, 206, 244);
}
tr:nth-child(odd) {
background-color: rgb(207, 230, 252);
}
tr:nth-child(even):hover {
background-color: rgb(242, 244, 245);
}
tr:nth-child(odd):hover {
background-color: rgb(242, 244, 245);
}
td:nth-child(even) {
vertical-align:middle;
text-align:left;
padding:10px;
}
td:nth-child(odd) {
vertical-align:middle;
text-align:left;
padding:10px;
}
.parallax-sec .blox{
padding:20px 0 0px;
}
.eleven.columns .shop-wrap figure{
margin-right: 3%;
}
table.product-details caption{
float:left;
}
.product-details{
width:100%;
}
.contact-inf p{
margin-bottom:10px;
}
.response{
height:600px;
width:80%;
margin:0 auto;
display:block;
padding:60px 50px;
text-align:center;
font-size:14;
}
.ls-layer h2{
font-size:40px !important;
}
/*---------Custom CSS--------------*/
<section class="container first-block aligncenter colorbar">
<hr class="vertical-space3">
<h2 class="mex-title">Welcome to the Polymers Enterprises</h2>
<h4 class="slight frontsight">Scaling new heights on the strength of Excellence, Efficiency & Ethics</h4>
<hr class="vertical-space3">
<div class="services">
<div class="one_fourth">
<article class="icon-box1"><i class="fa-user"></i>
<h5>ABOUT US</h5>
<p>For over 30 years, Polymers Enterprises has developed a record of service, growth and reliability unsurpassed....</p>
<button type="button" class="small skyblue demooo" onclick="window.location.href='about.html'">Read more</button>
</article>
</div>
<!--<div class="one_fourth">
<article class="icon-box1"><i class="li_bulb"></i>
<h5>EFFICIENCY</h5>
<p>We have made good relationship with customers by supplying them excellent quality products, which help us to ...</p>
<button type="button" class="small skyblue demooo" onclick="window.location.href='about.html'">Read more</button>
</article>
</div>-->
<div class="one_fourth">
<article class="icon-box1"><i class="li_note"></i>
<h5>WHAT WE DO</h5>
<p>Our policy is to achieve Quality in supply chain and maximize the serviceability to the client coupled with quality of cost....</p>
<button type="button" class="small skyblue demooo" onclick="window.location.href='about.html'">Read more</button>
</article>
</div>
<div class="one_fourth column-last">
<article class="icon-box1"><i class="fa-cubes"></i>
<h5>OUR PRODUCTS</h5>
<p>Polymer Enterprises provides a wide range of products and consulting services to customers .....</p>
<button type="button" class="small skyblue demooo" onclick="window.location.href='our_products.html'">Read more</button>
</article>
</div>
</div>
</section>
I have tried giving width display:block, display:inline-block and margin: 0 auto but no luck.Also I have been to almost all questions here but noone helped me. Can anyone help me get it sorted?
Here is Fiddle
Thanks !
Making them display: inline-block does work, you just need to remove the float.
.one_half, .one_third, .two_third, .three_fourth, .one_fourth, .one_fifth, .two_fifth {
margin-right: 3%;
display: inline-block; /* remove float and add display inline-block */
margin-bottom:2px;
}
Demo
Note: Add vertical-align:top; if you want the content in each to line up, demo here.
Im trying to create an HTML page but the content only starts below where the line of the left nav bar finished. i am trying to get the twi to line next to each other. I have tried floating the content but no luck so far
Heres my CSS, any help is greatly appreciated
body
{
margin: 0;
padding: 0;
font-family: arial, verdana, sans-serif;
color: #000;
background-color: #0099CC;
background-image: url(../Images/Background.jpg);
}
#banner
{
background-color: #87CEFA;
border-bottom: 1px solid #333;
text-align: center;
}
#banner h1
{
margin: 0;
padding: .5em;
}
#container
{
margin: 1em 5%;
background-color: #E0FFFF;
background-image: url(../Images/bluebackground.jpg);
background-repeat: repeat-y;
}
#content
{
padding-top: 0.5em;
margin: 0 2em 0 200px;
padding-bottom: 0.5em;
float:left;
}
#navigation {float:left; font-size:0.75em; width:178px; }
#navigation ul {margin:0px; padding:0px;}
#navigation li {list-style: none;}
ul.top-level { background:#1E90FF; }
ul.top-level li {
border-bottom: #fff solid;
border-top: #fff solid;
border-width: 1.5px;
}
#navigation a {
color: #fff;
cursor: pointer;
display:block;
height:25px;
line-height: 25px;
text-indent: 10px;
text-decoration:none;
width:100%;
}
#navigation a:hover{
text-decoration:underline;
}
#navigation li:hover {
background: #f90;
position: relative;
}
ul.sub-level {
display: none;
}
li:hover .sub-level {
background: #0000CD;
border: #fff solid;
border-width: 1px;
display: block;
position: absolute;
left: 168px;
top: 0px;
}
ul.sub-level li {
border: none;
float:left;
width:150px;
}
#nav p
{
margin-top: 0;
}
#footer
{
clear: both;
background-color: #78CEFA;
padding: 1em;
text-align: center;
border-top: 1px solid #333;
font-size:1em;
}
Try changing this:
#content
{
padding-top: 0.5em;
margin: 0 2em 0 200px;
padding-bottom: 0.5em;
float: left;
}
to this:
#content
{
padding-top: 0.5em;
margin: 0 2em 0 200px;
padding-bottom: 0.5em;
overflow: hidden;
}
(That is, change float: left; to overflow: hidden;)