How to center this image in div - html

I've tried alot of solutions and maybe I just implemented them wrongly for my code but I need help as my yr 11 task is due in 1 more day! Someone save me aha.
I apologize for not having a fiddle example to use as I don't know how to set it up or whatever, also the site just wants me to add more details so I'm just gonna keep writing till it lets me post cause I'm tired af and can't think. Whoever helps me your a bloody legend, cheers from straya :)
.slideshow {
display: none;
padding: 10px 0 10px 0;
margin-top: -50px;
font-size: 25px;
overflow-y: hidden;
}
.slide_selection {
display: inline-block;
padding: 20px 30px;
}
.slide_selection img {
height: 40px;
padding: 5px;
border-radius: 250px;
border: #00000099 2px solid;
transition: all .3s ease-in-out, border .5s;
}
.slide_selection img:hover {
background-color: #00000099;
}
.slide_icon {
display: inline;
float: left;
padding: 0 30px 0 30px;
transition: all .15s ease-in-out;
}
.slide_icon:hover {
transform: scale(1.3);
}
figcaption {
font-size: 10px;
font-weight: bold;
}
.slide_content {
background-color: #00000025;
box-shadow: inset 0 15px 10px -15px black, inset 0 -13px 10px -15px black;
margin: -10px 0 0 0;
padding: 30px 0;
display: inline-block;
}
.slide_content img {
height: 95px;
}
.slide_image {
width: 25%;
height: 100%;
float: left;
}
.slide_info {
display: inline-block;
float: right;
width: 75%;
text-align: left;
}
<div class="slideshow">
<div class="slide_selection">
<div onclick="test(1);" class="slide_icon"> <img src="https://i.stack.imgur.com/iplpF.png" alt="" />
<figcaption>WinRar</figcaption>
</div>
<div class="slide_icon"> <img src="https://i.stack.imgur.com/iplpF.png" alt="" />
<figcaption>OllyDBG</figcaption>
</div>
<div class="slide_icon"> <img src="https://i.stack.imgur.com/iplpF.png" alt="" />
<figcaption>NortonAV</figcaption>
</div>
</div>
<div class="slide_content">
<div class="slide_image">
<img src="https://i.stack.imgur.com/iplpF.png" alt="" />
</div>
<div class="slide_info">
<h4>Software Type: </h4>
<h4>Release Date: </h4>
<p>Winrar Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>

Can I be consider as bloody legend?
Codepen: http://codepen.io/anon/pen/NpoGPr
What I did is use flexbox to center the image.
justify-content is for horizontal centering
align-items is for vertical centering
.slideshow {
padding: 10px 0 10px 0;
margin-top: -50px;
font-size: 25px;
overflow-y: hidden;
}
.slide_selection {
display: inline-block;
padding: 20px 30px;
}
.slide_selection img {
height: 40px;
padding: 5px;
border-radius: 250px;
border: #00000099 2px solid;
transition: all .3s ease-in-out, border .5s;
}
.slide_selection img:hover {
background-color: #00000099;
}
.slide_icon {
display: inline;
float: left;
padding: 0 30px 0 30px;
transition: all .15s ease-in-out;
}
.slide_icon:hover {
transform: scale(1.3);
}
figcaption {
font-size: 10px;
font-weight: bold;
}
.slide_content {
background-color: #00000025;
box-shadow: inset 0 15px 10px -15px black, inset 0 -13px 10px -15px black;
margin: -10px 0 0 0;
padding: 30px 0;
display: flex;
height: 100%;
}
.slide_content img {
height: 95px;
}
.slide_image {
width: 25%;
display: flex;
align-items: center;
justify-content: center;
}
.slide_info {
display: inline-block;
width: 75%;
text-align: left;
}
<div class="slideshow">
<div class="slide_selection">
<div onclick="test(1);" class="slide_icon"> <img src="https://i.stack.imgur.com/iplpF.png" alt="" />
<figcaption>WinRar</figcaption>
</div>
<div class="slide_icon"> <img src="https://i.stack.imgur.com/iplpF.png" alt="" />
<figcaption>OllyDBG</figcaption>
</div>
<div class="slide_icon"> <img src="https://i.stack.imgur.com/iplpF.png" alt="" />
<figcaption>NortonAV</figcaption>
</div>
</div>
<div class="slide_content">
<div class="slide_image">
<img src="https://i.stack.imgur.com/iplpF.png" alt="" />
</div>
<div class="slide_info">
<h4>Software Type: </h4>
<h4>Release Date: </h4>
<p>Winrar Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>

i did nt understand your code but i think you need a div container you divise it as much as you need then you put your image in the middle of the page here is an simple example
<div class="container">
<div class="row">
<div class="igreen col-sm-5 col-md-5 col-lg-5">this is will be green area</div>
<div class="col-sm-2 col-md-2 col-lg-2"></div>
<div class="col-sm-5 col-md-5 col-lg-5">step1</div>
<div class="col-sm-5 col-md-5 col-lg-5">step1</div>
<div class="col-sm-2 col-md-2 col-lg-2"> <img src="my_image.png"></div>
<div class="ired col-sm-5 col-md-5 col-lg-5">this is will be a red area</div>
<div class="col-sm-5 col-md-5 col-lg-5">step1</div>
<div class="iblue col-sm-2 col-md-2 col-lg-2">this is the blue </div>
<div class="col-sm-5 col-md-5 col-lg-5">step1</div>
</div>
this is a container

Related

SOLVED - Why is this bootstrap card misaligned?

The image and text of this bootstrap card are supposed to be side by side, with the combo title + text centralized in relation to the image. But they are somewhat above the image.
Image of how it looks:
HTML:
<div class="card bg-transparent border-0 text-white mb-3" >
<div class="row g-0">
<div class="col-md-6">
<img src="../assets/images/cp/sobre-cid-1.jpg" class="img-fluid rounded-start img-esq" alt="cid-1">
</div>
<div class="col-md-6">
<div class="card-body">
<h3 class="card-title">TITLE</h3>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>
</div>
CSS:
.img-fluid.rounded-start {
height: calc(120px + 10vw);
width: 90vw;
object-fit: cover;
}
.img-esq {
border-radius: 0px 30px 30px 0px;
}
.img-dir {
border-radius: 30px 0px 0px 30px;
}
.card-title {
font-family: 'Martel';
font-size: 22px;
padding: 20px;
text-align: left;
font-weight: 600;
}
.card-title-right {
font-family: 'Martel';
font-size: 22px;
padding: 20px;
text-align: right;
font-weight: 600;
}
.card-text {
font-family: 'Martel';
font-size: 14px;
padding-left: 20px;
padding-right: 30px;
text-align: left;
}
.card-text-right {
font-family: 'Martel';
font-size: 14px;
padding-left: 30px;
padding-right: 20px;
text-align: right;
}
Additional info: The card is inside a div that gets the entire page, this is it's CSS:
.bg {
background-image: url(../images/cp/fundo.png);
background-position: center;
background-repeat: repeat-y;
background-size: cover;
margin-top: 0px;
text-align: center;
color: white;
display: flex;
flex-direction: column;
justify-content: center;
}
I mostly looked for margins and paddings. I tried changing padding-top and margin-top to zero, I even looked for this in the item above the bootstrap card, but nothing helped, there was only a br tag between the item above the card and the card itself. I also looked for a margin in the card and everything seems right.
EDIT 1:
I added to .row a display: flex and align-items:center, it is not perfectly centered but maybe I can use it, but there's still a big space in between each card:
EDIT 2:
I added to .row a margin-top: -80px and now the space between cards is good. Not the perfect solution I think but works for now.
To make the text vertically centered in relation to the image, I added margin-top: 60px to the cards' titles, and it pushed them down. Again, not perfect but works for now.
EDIT 3:
I fixed it. The problem was in a part of the CSS code I didn't know influenced the whole page. It was like this:
img {
width: 70%;
height: auto;
margin-top: 15%;
}
I thought it would only influence the class that was above it. Turns out, it influenced all the img tags.
I found out by deleting part by part of the CSS code in Codepen.
The problem may be caused by the calc() function in the height property for the img-fluid.rounded-start class. This function calculates the height of the image based on the size of the viewport, which could be causing the image to be larger or smaller than expected. Try to set fixed values to it.
Also, you can try and use align-items: center in the .bg class, this should align the elements at the center of the div.

Rotate text 90 degrees and vertically center next to wrapped inline text

I am trying to rotate text 90 degrees and vertically center it next to inline wrapped text. I need to keep the text inline so I can left-align the text itself, then center the whole thing when the text wraps.
It seems to work fine in Chrome when the text is on one line and when wrapped. In Firefox it seems to work fine when the text is on one line, but when wrapped, it does not vertically center the rotated text.
It seems like Firefox is not recognizing the height of the wrapped text.
Here is a fiddle showing what I'm working with. https://jsfiddle.net/hemmieweizen/7t5gh91z/12/ Notice on Firefox when you decrease the width of the output and the text wraps, the vertical text does not continue to center.
.title-container {
font-size: 70px;
position: relative;
}
.title-container .title {
position: relative;
}
.title-container .pre-title {
position: absolute;
bottom: 50%;
left: -55px;
transform: rotate(-90deg);
transform-origin: center bottom;
height: 22px;
border-bottom: 1px solid #000;
font-size: 16px;
text-transform: uppercase;
}
<h2 class="title-container m-b-0">
<span class="title">
<span class="pre-title h6 m-b-0">Your Agent</span>
Charles Smith
</span>
</h2>
Try to use a layout like flex; make both <span>Charles Smith</span> and <span>Your Agent</span> direct children of <h2> rather than nested children. Remove the hard-coded position rules from these elements, and let the flexbox manage them for you. You can still refine their positions with mere margin and padding.
#import url("https://d133rs42u5tbg.cloudfront.net/hero/assets/css/kv-custom-colors.css");
.title-container {
font-size: 70px;
position: relative;
display: flex; /* ADDED THIS NEW RULE */
flex-direction: row; /* ADDED THIS NEW RULE */
}
.title-container .pre-title { /* DID NOT CHANGE ANYTHING HERE */
position: absolute;
bottom: 50%;
left: -55px;
transform: rotate(-90deg);
transform-origin: center bottom;
height: 22px;
border-bottom: 1px solid #000;
font-size: 16px;
text-transform: uppercase;
}
.title-container .title {
/* REMOVED OLD POSITION RULE */
}
<section id="custom-about" class="position-relative p-y-3">
<div class="container p-y-3">
<div class="row">
<div class="col-xs-12 col-md-6">
<h2 class="title-container m-b-0">
<!-- CHANGED HIERARCHICAL STRUCTURE HERE -->
<span class="pre-title h6 font-sans m-b-0">Your Agent</span>
<span class="title">Charles Smith</span>
</h2>
</div>
<div class="col-xs-12 col-md-6 m-t-2">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
<div class="col-xs-12 col-md-6 col-md-offset-6">
<div class="text-center">
<a class="btn btn-white" href="contact">Contact</a>
</div>
</div>
</div>
</div>
</section>

How can I make A Pipeline Using Border In CSS

Maybe from the title above some of you will become confused, But it exactly as the title said, I want to make this pipeline design using CSS, I think I can achieve it using border but how can I add the round bullet like in the image below?
to make it easier, my layout will look like this:
First row : Image 1 & text
second row : Text & Image 2
Third row : Image 3 & text
fourth row : Image 4
so this is some question I want to ask:
Can I make this kind of line using the border?
How can I make the line stop in the middle like before the Image 4?
How can I make the bullet in the middle of the line that will match the line even when we check it in some device (exclude the mobile view around 576px)?
Can someone help me with this problem? for the first question, I think we can use
1. First Row :
border-right: solid 1px blue;
border-bottom : solid 1px blue;
border-bottom-right-radius : 10px;
2. second Row :
border-left: solid 1px blue;
border-bottom : solid 1px blue;
border-bottom-left-radius : 10px;
3. Third Row :
border-right: solid 1px blue;
border-bottom : solid 1px blue;
border-bottom-right-radius : 10px;
4. Fourth Row :
border-left: solid 1px blue;
border-bottom : solid 1px blue;
border-bottom-left-radius : 10px;
width: 50% (?)
Edit 1
for question one currently I make this CSS code like this:
#first-row-left{
border-left: solid 3px blue;
border-bottom: solid 3px blue;
border-bottom-left-radius: 20px
}
#first-row-right{
border-bottom: solid 3px blue;
}
#second-row-left{
border-bottom: solid 3px blue;
}
#second-row-right{
border-right: solid 3px blue;
border-bottom: solid 3px blue;
border-top-right-radius: 20px;
border-bottom-right-radius: 20px
}
#third-row-left{
border-left: solid 3px blue;
border-bottom: solid 3px blue;
border-bottom-left-radius: 20px;
border-top-left-radius: 20px
}
and it looks like this
As you can see there is slight miss in before the pipeline change the row like from first to second row
Edit 2 I already make a fiddle for this, you can try it in here:
Click here to see the fiddle
Edit 3
Based on #Alexwc_ , I tried to change his code into CSS intead of SCSS, but it seems I miss something in here
SCSS from #Alexwc_ after I convert it to CSS:
this is the fiddle I made : Check in here
Here's one method. Perhaps not the cleanest, and it hasn't been adapted for mobile.
Here is a pen of the work using SCSS.
Here is a pen of the work using CSS. (Please note that I converted SCSS to CSS using this tool)
CAVEATS:
this was not put into a SO snippet because (for whatever reason) it doesn't display correctly.
I've tested only on Mac OS Chrome/Chrome Canary/FF/FFDE/Safari
On the CodePen I used SCSS
My CSS/SCSS/variables may cause some snickering as I'm no pro at it, and it feels a little hacky... but perhaps other edge-ish cases may cause the same feeling.
I did not see that you had posted your own markup while I was writing this out. Apologies for that.
The bullets can be edited to however you like, I figured the bullet styles weren't the real issue here.
CSS:
:root {
--width: 5px;
--border-radius: calc(var(--width) * 2);
--button-width: 30px;
--button-left-pos: -12.5px;
}
.row {
margin: 0 20px;
}
img {
border-radius: 10px;
}
.one, .two, .three, .four {
position: relative;
}
.one::before, .one::after, .two::before, .two::after, .three::before, .three::after, .four::before, .four::after {
position: absolute;
top: var(--button-width);
left: var(--button-left-pos);
content: "";
height: 30px;
width: 30px;
background: black;
border-radius: 100px;
}
.one::after, .two::after, .three::after, .four::after {
width: calc( var(--button-width) / 2 );
height: calc( var(--button-width) / 2 );
background: red;
top: calc(var(--button-width) + var(--button-width) / 4 );
left: -5px;
}
.two::before, .two::after {
right: var(--button-left-pos);
left: initial;
}
.two::after {
right: -5px;
}
.one::after {
width: calc( var(--button-width) / 2 );
height: calc( var(--button-width) / 2 );
background: red;
top: calc(var(--button-width) + var(--button-width) / 4 );
}
.row {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: "left right";
position: relative;
}
.row:last-child {
grid-template-areas: "border ..." "full full";
}
.row .left, .row .right {
padding: var(--button-width);
}
.one .left {
padding-top: 0;
border-left: var(--width) solid;
border-bottom: var(--width) solid;
border-bottom-left-radius: var(--width);
}
.two {
top: calc(var(--width) * -1);
}
.two .right {
border-right: var(--width) solid;
border-top: var(--width) solid;
border-top-right-radius: var(--width);
border-bottom-right-radius: var(--width);
border-bottom: var(--width) solid;
}
.three {
top: calc(var(--width) * -2);
}
.three .left {
border-left: var(--width) solid;
border-top: var(--width) solid;
border-top-left-radius: var(--width);
border-bottom-left-radius: var(--width);
}
.four {
top: calc(var(--width) * -3);
}
.four::before, .four::after {
top: 85px;
}
.four::before {
left: calc(50% - 17.5px);
}
.four::after {
top: 92.5px;
left: calc(50% - 10.5px);
}
.four .border {
height: 200px;
display: block;
border-right: var(--width) solid;
border-top-right-radius: var(--width);
position: relative;
}
.four .border::before {
content: "";
position: absolute;
height: var(--width);
background: black;
top: 0;
width: calc(100% + var(--width));
transform: rotate(180deg);
border-bottom-left-radius: var(--width);
border-top-right-radius: var(--width);
}
.border {
grid-area: border;
}
.full-width {
grid-area: full;
justify-self: center;
}
.left {
grid-area: left;
}
.right {
grid-area: right;
}
HTML:
<div class="row one">
<div class="left">
<img src="https://via.placeholder.com/450x250" alt="">
</div>
<div class="right">
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
<!-- one -->
<div class="row two">
<div class="left">
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="right">
<img src="https://via.placeholder.com/450x250" alt="">
</div>
</div>
<!-- two -->
<div class="row three">
<div class="left">
<img src="https://via.placeholder.com/450x250" alt="">
</div>
<div class="right">
<h1>Heading</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
<!-- three -->
<div class="row four">
<div class="border border-top"></div>
<div class="full-width">
<img src="https://via.placeholder.com/900x500" alt=""></div>
</div>
<!-- four -->
You may consider using SVG. Following code is a sample code to draw path and circle.
<!DOCTYPE html>
<html>
<body>
<svg height="400" width="450">
<path id="lineAB" d="M 100 350 l 150 -300" stroke="red" stroke-width="3" fill="none" />
<path id="lineBC" d="M 250 50 l 150 300" stroke="red" stroke-width="3" fill="none" />
<path d="M 100 350 q 150 -300 300 0" stroke="blue" stroke-width="5" fill="none" />
<g stroke="black" stroke-width="3" fill="black">
<circle id="pointA" cx="100" cy="350" r="3" />
<circle id="pointB" cx="250" cy="50" r="3" />
<circle id="pointC" cx="400" cy="350" r="3" />
</g>
<g font-size="30" font-family="sans-serif" fill="black" stroke="none" text-anchor="middle">
<text x="100" y="350" dx="-30">A</text>
<text x="250" y="50" dy="-10">B</text>
<text x="400" y="350" dx="30">C</text>
</g>
Sorry, your browser does not support inline SVG.
</svg>
</body>
</html>
`#first-row-left:before
{
content: '';
display: inline-block;
position: absolute;
border-radius: 50%;
left: 0;
width: 10px;
height: 10px;
z-index: 3;
top: 25px;
}`
try something like this...
You can use the border-image property to draw a custom svg for your border. Have a look at this article to see an example.
The Round bullet can be done with an external div like
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div id='bullet'></div>
</body>
</html>
#bullet{
background-color:#fff310;
height:10px;
width:10px;
border-radius:50%;
border:0.1px solid red;
}

Second CSS does not link/apply

I am testing my codes parallel to a video tutorial. I have two CSS files. First one is working fine. Second CSS doesn't seems to apply to the HTML. My folder structure is as follows.
/
css (screen_style.css, screen_layout_large.css)
images (banner_large.jpg, logo_large.png, etc)
index.html
HTML
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0" />
<title>Lynda.com | Creating a Responsive Web Design</title>
<link rel="stylesheet" type="text/css" href="css/screen_styles.css" />
<link rel="stylesheet" type="text/css" href="css/screen_layout_large.css" />
</head>
<body>
<div class="page">
<header>
<a class="logo" href="#"></a>
</header>
<article>
<h1>Welcome</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
<div class="promo_container">
<div class="promo one">
<div class="content">
<h3>Promo Heading Here</h3>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
<p><a class="cta" href="">Visit our blog</a></p>
</div>
</div>
<div class="promo two">
<div class="content">
<h3>Promo Heading Here</h3>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit est laborum.</p>
<p><a class="cta" href="">Read the article</a></p>
</div>
</div>
<div class="promo three">
<div class="content">
<h3>Promo Heading Here</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor inci did unt.</p>
<p><a class="cta" href="">Learn more</a></p>
</div>
</div>
</div>
<nav>
About Us
Contact Us
</nav>
<footer>
© AG IT Solutions.
</footer>
</div>
</body>
</html>
CSS/screen_tyle
#charset "UTF-8";
/* Global Content Formatting and Styles */
body {
color: #575c7a;
line-height: 1.5em;
font-family: Arial;
font-size: 14px;
background:#515673 url(../images/background_gradient.jpg) repeat-x 0 0;
}
.page {
max-width: 980px;
margin: 0 auto 0 auto;
padding: 0;
position: relative;
background-color: #fff;
}
h1 {
font-size: 2em;
font-weight: normal;
color: #a6430a;
margin: 0 0 0.5em 0;
}
h2 { font-size: 1.7em; margin: 0 0 1em 0;}
h3 { font-size: 1.5em; margin: 0 0 1em 0;}
p { margin:0 0 0.75em 0;}
a { color:#de9000;}
a:hover {color:#009eff;}
a.cta {
text-transform: uppercase;
font-size:.9em;
font-weight:bold;
text-decoration:none;
margin: .5em 0 0 0;
padding: 0 12px 0 0;
background: url(../images/cta_arrow.png) no-repeat right 0;
}
a.cta:hover {
background-position:right -50px;
}
.promo h3 {font-size: 1.1em; margin:0;}
.promo p {line-height:1.2em; font-size:.9em; margin-bottom:.5em;}
.promo { background-repeat: no-repeat;}
.promo.one { background-image: url(../images/promo_1.jpg);}
.promo.two { background-image: url(../images/promo_2.jpg);}
.promo.three { background-image: url(../images/promo_3.jpg);}
footer {
font-size: .85em;
color: #9ba0bd;
background-color:#575c7a;
padding: 10px 10px 10px 10px;
}
css/screen_layout_large
#charset "UTF-8";
/* Layout (global rules for all sizes) */
body {
margin: 0;
padding: 0;
}
header a.logo {
display: block;
position: absolute;
background-position: 0 0;
background-repeat: no-repeat;
}
/* Layout Large Screens (default for older browsers) */
header {
height: 275px;
background: url(../images/banner_large.jpg) no-repeat right 0;
}
header a.logo {
width: 150px;
height: 85px;
top: 28px;
right: 30px;
background-image: url(../images/logo_large.png);
}
None of the images are loading in header section which are scripted in screen_layout_large.css. Padding also not working. I have tried including !important with css attributes. But problem seems to be the CSS is not linking. When I remove the first CSS, it has only plain HTML.
Try to open your developer tools (F12 for google chrome) and inside head element find your two links to css files. Mouse2 -> Open link in new tab
If both files will not be empty (you should see any your css properties), let us to know. If one of them is empty, it means that you didn't connect it correctly.
Clear browser cash was the solution at this particular issue...

Align 2 DIV per line, both the with the same height

We have a problem where we need to have a list of divs with dynamic content.
There will always be 2 divs per row. Both of those elements should have the same height.
Currently we have a solution which sets the height of the boxes with JavaScript, but it's not very performant, since it recalculates the sizes on every resize (Responsive design).
Is there a solution without fixed height values?
Important: The boxes still need to be padded, and the padding needs to be in percent (currently 4% margin on div)
Jsfiddle: http://jsfiddle.net/6dmwU/
<div class="boxes">
<div class="box-wrapper">
<div class="box" style="height: 203px;">
<p class="box-title">Lorem Vulputate</p>
<p>On corerias sunturero in cullabore dolestionet apid utatur On corerias sunturero in cullabore dolestionet apid utatur</p>
</div>
<div class="box" style="height: 203px;">
<p class="box-title">Egestas Pharetra</p>
<p>On corerias sunturero in cullabore dolestionet apid utatur</p>
</div>
</div>
<div class="box-wrapper">
<div class="box" style="height: 151px;">
<p class="box-title">Vulputate Egestas</p>
<p>On corerias sunturero in cullabore dolestionet apid utatur</p>
</div>
<div class="box" style="height: 151px;">
<p class="box-title">Egestas Pharetra</p>
<p>On corerias sunturero in cullabore dolestionet apid utatur</p>
</div>
</div>
</div>
Any help will be very appreciated
You can use a flex model for this:
.boxes .box
{
margin-left: 2%;
margin-bottom: 2%;
width: 50%;
padding: 4%;
border: 1px solid #b6b6b6;
border: 0.0625rem solid #b6b6b6;
box-sizing: border-box;
}
.box-wrapper
{
width: 100%;
display: -webkit-box;
display: -moz-box;
display: -webkit-flexbox;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
jsFIddle
This way every row will be the height of the highest child element.
However the support for this is limited.
So if you rather not use this method you can transform you structure in a table structure. This way every row will be the height of the highest child element.
.boxes .box
{
display: table-cell;
margin-left: 2%;
margin-bottom: 2%;
width: 50%;
padding: 4%;
border: 1px solid #b6b6b6;
border: 0.0625rem solid #b6b6b6;
box-sizing: border-box;
}
.box-wrapper
{
display: table-row;
}
.boxes
{
display: table;
border-collapse: separate;
border-spacing: 5px;
}
Because margin doesn't work between table-cells i used border-spacing to define the seperation between the cells.
jsFiddle
Try this
.boxes .box {
float: left;
margin-left: 2%;
margin-bottom: 2%;
width: 38%;
padding: 4%;
border: 1px solid #b6b6b6;
border: 0.0625rem solid #b6b6b6;
box-sizing: border-box;
display:inline-block
}
.box-wrapper,.boxes{
display:inline-block;
width:100%;
}
Fiddle
Have a look at this fiddle You can use display:table-cell;
CSS:
.row {
display: table;
width: 100%;
}
.left {
width:50%;
background: blue;
display:table-cell;
}
.right {
width:50%;
background: red;
display:table-cell;
}
HTML
<div class='row'>
<div class='left'>
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</div>
<div class='right'>
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos
</div>
</div>
I use flexbox, it's magic ^^ :
HTML
<div class="boxes">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
CSS
.boxes {
display: flex;
flex-wrap: wrap;
}
.box {
margin: 0 1% 1% 0;
width: 48%;
}
CODEPEN DEMO
Complete guide to flexbox on css-trick