I've got an <li> with a custom bullet background-image. Now, I'd like to have the text in the bullet be outside the marker, using the list-item-position: outside in CSS. However, it does not seem to be working. The second line still starts at the start of the container (under the image). My html looks like this:
<ul className={styles.missieTxt}>
<li className={styles.bulletsMissie}>
... lorem ipsum lorem ipsum lorem, {" "}
<span className={styles.focusMissie}>100% </span>lorem
</li>
<li className={styles.bulletsMissie}>
... lorem ipsum <span className={styles.focusMissie}>lorem</span>
, lorem ipsum lorem ipsum
</li>
<li className={styles.bulletsMissie}>
... <span className={styles.focusMissie}>lorem</span> lorem ipsum
<span className={styles.focusMissie}>lorem</span>
</li>
</ul>
the css for this looks like this:
.missieTxt {
display: flex;
flex-direction: column;
}
.bulletsMissie {
list-style-type: none;
position: relative;
font-size: clamp(0.8rem, 1.3vw, 1.5rem);
margin-right: 1rem;
list-style-position: outside;
}
.bulletsMissie::before {
content: "";
display: inline-flex;
height: 20px;
width: clamp(25px, 3vw, 48px);
background-image: url(../images/overOns/bulletsImg.png);
background-repeat: no-repeat;
background-size: 100%;
align-items: center;
margin-right: 0.5rem;
}
.focusMissie {
color: #78c0a8;
font-weight: bold;
}
If screens are smaller, and the text overflows to the second line, it just starts under the image, which I do not want. Does anyone have a solution to this? :(
Thank you in advance!
Try this and see if it works.
.missieTxt {
display: flex;
flex-direction: column;
}
.bulletsMissie {
list-style-type: none;
position: relative;
font-size: clamp(0.8rem, 1.3vw, 1.5rem);
margin-right: 1rem;
list-style-position: outside;
display: block;
padding-left: clamp(25px, 3vw, 48px);
}
.bulletsMissie::before {
content: "";
display: block;
position: absolute;
left: 0;
top: 0;
height: 20px;
width: clamp(25px, 3vw, 48px);
background-image: url(../images/overOns/bulletsImg.png);
background-repeat: no-repeat;
background-size: 100%;
}
.focusMissie {
color: #78c0a8;
font-weight: bold;
}
you might want to consider changing: list-style-type: none;
in .bulletsMissie
to list-style-image: url(../images/overOns/bulletsImg.png);
and the list-item-position: outside, will work.
Related
I'm having problems trying to make the bottom of my div to look like this.
I tried using border radius to get the curved result at the bottom right but I don't know how can I create this straight line at an angle.
Here's my current code.
<div>The code is in the link</div>
Check out this code and use the transform property Perspective
transform: perspective(value);
The mention thing is an illustration used as the background image. It would be a good practice if you try it so check out my Codepen Work for source code.
.innerlayer{
width: 650px;
height: 400px;
background-color: #00bcd4;
margin: auto;
transform: perspective(1000px) rotatey(18deg);
border-bottom-right-radius: 35%;
}
.outerlayer{
position: relative;
padding: 0px;
}
.tophidden{
width: auto;
height: 80px;
background-color: #fff;
position: absolute;
top: -80px;
left: 50%;
transform: translateX(-50%);
}
<div class="outerlayer">
<div class="tophidden">
<div class="innerlayer"></div>
</div>
</div>
Watch it in full screen view
I suggest you to use :before pseudo element, and skew it.
Here you can find your modified code
body {
margin: 0;
}
.navbar {
// make sure wrapper of pseudo has position: relative
position: relative;
&:before {
content: '';
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
z-index: -1;
background: linear-gradient(72deg, rgba(100,36,220,1) 0%, rgba(118,107,254,1) 100%);
// set border radius size
border-bottom-right-radius: 10rem;
// set skew angle
transform: skewY(-2deg);
transform-origin: left bottom;
}
.container {
display: flex;
justify-content: space-between;
margin-left: auto;
margin-right: auto;
max-width: 1270px;
width: 100%;
padding: 1.125rem 1.5rem 1.125rem 1.5rem;
}
.logo {
color: white;
margin-right: 3em;
text-transform: lowercase;
font-size: 42px;
align-items: center;
font-weight:700;
}
nav {
display: flex;
margin-top: 1em;
}
.primary-nav {
display: flex;
align-items: center;
}
.nava {
font-size: 20px;
font-weight: 400;
}
a {
color: white;
margin-right: 1em;
}
.second-nav {
display: flex;
align-items: center;
}
.contact-nav {
font-size: 20px;
font-weight: 700;
text-transform: uppercase;
color: #5008d9;
background:white;
border-radius: 360px;
padding: 0.9rem 2rem 0.9rem 2rem;
}
.cda {
display: flex;
justify-content: space-between;
padding-top: 5em;
padding-bottom: 5em;
}
.cta-left {
height: 100%;
width: 50%;
display: flex;
flex-direction: column;
margin-top: 5em;
padding-bottom: 15em;
}
h2 {
color: white;
font-size: 70px;
font-weight: 600;
line-height: 1.0;
}
p {
color: white;
}
.cta-right {
width: 50%;
}
img {
width: 100%;
}
.cta-p {
margin-top: 2em;
}
.learn-more {
margin-top: 3em;
}
.learn {
font-size: 20px;
font-weight: 500;
text-transform: uppercase;
color: black;
background:#00dadc;
border-radius: 360px;
padding: 0.9rem 4rem 0.9rem 4rem;
}
}
<header>
<div class="navbar">
<div class="container">
<nav>
<ul class="primary-nav">
<a class="logo" href="#">Agency</a>
<li><a class="nava" href="#">Home</a></li>
<li><a class="nava" href="#">About Us</a></li>
<li><a class="nava" href="#">Our Services</a></li>
<li><a class="nava" href="#">Support</a></li>
</ul>
</nav>
<nav>
<ul class="second-nav">
<li><a class="contact-nav" href="#">Contact</a></li>
</ul>
</nav>
</div>
<div class="container">
<div class="cda">
<div class="cta-left">
<h2>Creative <br> Design Agency</h2>
<p class="cta-p">Lorem ipsum dolor sit amet, consectetur adipisicing elit. <br> Etiam vel dolor id nulla gravida blandit.</p>
<div class="learn-more">
<a class="learn" href="#">Learn More</a>
</div>
</div>
<div class="cta-right">
<img src="images/doge.jpeg" alt="">
</div>
</div>
</div>
</div>
</header>
I'm making a project with a big image at the top of the page, followed by a sticky nav.
The info following the nav keeps trespassing!
I have been trying all sorts of things, making the other sections after it have a lower or negative z-index numbers, as well as trying to set the opacity to 99 for the following modules because I read that opacity changes the stacking order.
/*Navigation*/
navigation {
display: block;
box-shadow: 0px 10px 22px #326559;
}
.z {
position: relative;
position: -webkit-sticky;
position: sticky;
top: 0px;
z-index: 500;
}
nav {
display: block;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 10px;
align-items: center;
}
nav img {
max-width: 9vw;
}
/*Annonce*/
.annonce {
position: relative;
z-index: -1;
opacity: .99;
}
.annonce p {
margin-top: 50px;
margin-bottom: 50px;
padding: 10px;
}
.annonce img {
padding-bottom: 50px;
}
/*Location Gallery*/
hr {
background-color: #326557;
height: 3px;
margin-bottom: 75px;
}
location-card {
display: block;
border: 2px solid #326557;
margin-bottom: 50px;
background-color: #e5fbe2;
padding: 20px;
position: relative;
z-index: -1;
}
<navigation class="z">
<inner-column>
<nav>
<a href="#" class="icon">
<img src="images/bla.png">
</a>
Sign in
</nav>
</inner-column>
</navigation>
<main>
<section class="annonce">
<inner-column>
<p>Bla bla bla!</p>
</inner-column>
<picture>
<img src="images/image1.jpg">
</picture>
</section>
<?php include('locationCards.php'); ?>
Working on my sticky
I'm going to include my html for the nav.
And a little bit of what comes after that.
I'm including some CSS for both the nav and what comes after, in case another more skilled person can see what my issue is.
Thanks so much
I have already created a site like that, You can search it on google using keywords. "Sticky Navbar".
and I'm going to share my code with you too.
window.onscroll = function () { myFunction() };
var header = document.getElementById("header");
function myFunction() {
if (window.pageYOffset >= 30) {
header.classList.add("sticky")
} else {
header.classList.remove("sticky");
}
}
body{
margin:0;
}
header{
position: fixed;
width: 100%;
padding: 5px 20px;
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
transition: 0.75s;
}
header .logo{
color: rgb(255, 255, 255);
font-weight: 700;
font-size: 30px;
text-decoration: none;
}
header .nav{
position: relative;
display: flex;
}
header .nav li{
list-style: none;
margin-left: 50px;
height:100%;
}
header .nav li a{
text-decoration: none;
color: #fff;
font-weight: 300;
font-size: 20px;
}
header.sticky{
background: rgba(255,255,255,0.85);
padding-top:0px;
padding-bottom:0px;
box-shadow: 0 5px 20px rgba(0,0,0,0,0.5);
height:3.75rem;
}
header.sticky .logo{
color: rgb(0, 0, 0);
}
header.sticky ul{
height:100%;
}
header.sticky ul li{
height:100%;
display:flex;
align-items: center;
}
header.sticky ul li a{
color:rgb(204, 34, 34);
}
header.sticky .nav li:hover{
border-bottom: 5px solid #ff0157;
}
p{
font-weight: 300;
color: #111;
}
.ban{
position: relative;
width: 100%;
height: 600px;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(45deg,rgba(255,255,255,0.1),rgba(0,0,0,0.35)),url('https://winteriscoming.net/files/2021/01/thor-4-marvel-chris-hemsworth.jpg');
background-repeat: no-repeat;
background-size:cover;
background-position:left;
}
.ban .box{
max-width: 1000px;
text-align: center;
}
.ban .box h3{
font-size: 5rem;
color: #fff;
}
.ban .box p{
font-size: 1rem;
color: #fff;
}
<header id="header">
Avenger
<ul class="nav">
<li>Home</li>
<li>About</li>
<li>Menu</li>
<li>Expert</li>
<li>contact</li>
</ul>
</header>
<section class="ban" id="ban">
<div class="box">
<h3>Always Choose Good</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam sit nemo blanditiis tenetur, autem enim
similique dolor saepe earum consequuntur.</p>
Our Menu
</div>
</section>
I think this will help you more!
Why is my header background is behaving this way and how to change my HTML/CSS in order to ensure the header BG looks the same no matter the screen width, same with the footer. I've tried lots of things and I'm just learning.
I'm including screenshots for specificity.
Here is my HTML:
<!-- ------------------------------- Header -------------------------------- -->
<header>
<div class="container">
<nav class="header-nav">
<div class="logo-container"><h3>travel</h3></div>
<ul class="nav-links">
<li class="nav-link">home</li>
<li class="nav-link">about</li>
<li class="nav-link">blog</li>
<li class="nav-link">contact</li>
</ul>
</nav>
<h1>travel outdoor ipsum dolor sit.</h1>
</div>
</header>
<!-- ------------------------------- Header -------------------------------- -->
<!-- ------------------------------- Footer -------------------------------- -->
<footer>
<div class="container">
<div class="footer-wrapper">
<nav class="footer-nav">
<div class="footer-logo"><h3>travel</h3></div>
<div class="footer-menus">
<ul class="footer-links">
<li>home</li>
<li>about</li>
<li>blog</li>
<li>contact</li>
</ul>
<ul class="social-links">
<li>twitter</li>
<li>facebook</li>
<li>linkedin</li>
</ul>
</div>
<div class="legal">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Expedita error temporibus quod ipsam suscipit exercitationem possimus autem ad.</>
</div>
</nav>
<div class="thin-line"></div>
<p>Travel Agency</p>
</div>
</div>
</footer>
<!-- ------------------------------- Footer -------------------------------- -->
CSS:
.container {
width: 1000px;
margin: 0 auto;
}
/* ------------------------------ Global Styles ----------------------------- */
/* ---------------------------------- Header --------------------------------- */
h1 {
font-weight: 700;
color: #333333;
font-size: 6.8rem;
position: relative;
top: 100px;
letter-spacing: 1.5px;
width: 550px;
}
.header-nav a {
font-size: 1.9rem;
font-weight: 700;
color: #333333;
text-transform: uppercase;
padding: 10px;
}
.header-nav a:hover {
background-color: #16D6D1;
border-radius: 1rem;
border-style: none;
color: #F6F8FA;
}
.header-nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo-container {
position: relative;
}
.nav-links {
display: flex;
}
.nav-link {
margin-right: 3rem;
}
header {
height: 50vh;
width: 100%;
background: url(./images/image-main.jpeg);
background-repeat: no-repeat;
background-size: cover;
overflow: hidden;
}
/* ---------------------------------- Header --------------------------------- */
/* --------------------------------- Footer --------------------------------- */
footer {
background: #F6F8FA;
}
.footer-wrapper {
height: 350px;
}
.footer-nav {
display: flex;
justify-content: space-between;
align-items: baseline;
}
.footer-menus {
display: flex;
position: relative;
left: 125px;
text-transform: uppercase;
line-height: 40px;
margin-top: 25px;
margin-bottom: 75px;
}
.footer-menus a {
color: #333333;
font-size: 1.9rem;
font-weight: 700;
}
.footer-links {
margin-right: 25px;
}
.social-links {
margin-right: 25px;
}
.legal {
width: 275px;
line-height: 30px;
color: #777777;
}
.thin-line {
border-bottom: 1px solid #777777;
}
footer p {
font-weight: 500;
color: 777777;
}
/* --------------------------------- Footer --------------------------------- */
Screenshots of page:
What I want it to look like:
page snapshot, intended look as static
What's happening that I don't want:
...not what I want
Any feedback also is welcome, learning and improving! Thank you very much in advance anyone who can take the time to give some advice.
Basically, we added a new div right after the header, in main element, we gave it a class and styled the width 100%, height 600px and background-image to cover the div which fits on it's place, exactly under the header.
Open Full Page it's responsive (The other content of the page below also styled mobile responsive Basic setup).
I hope this helps,
Enjoy your time coding =D.
* {
margin: 0;
padding: 0;
}
body {
font-family: 'Arial', sans-serif;
font-size: 10px;
}
.container {
width: 100%;
padding: 0 15px;
margin: 0 auto;
position: relative;
}
#media (min-width: 576px) {.container {max-width: 540px;}}
#media (max-width:576px) {.container {padding: 0;}}
#media (min-width: 768px) {.container {max-width: 760px;}}
#media (min-width: 992px) {.container {max-width: 960px;}}
#media (min-width: 1200px) {.container {max-width: 1190px;}}
header {
height: 70px;
display: flex;
align-items: center;
}
.navbar {
display: flex;
justify-content: space-around;
}
.list {
list-style-type: none;
display: flex;
}
.item {
font-size: 1.1rem;
margin: 0 10px;
text-transform: uppercase;
font-weight: bold;
color: #1a4379;
}
.main-box {
background-image: url(https://www.w3schools.com/w3css/img_lights.jpg);
height: 600px;
width: 100%;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
margin-bottom: 30px;
}
.other-content {
position: relative;
width: 100%;
height: 450px;
display: flex;
margin-bottom: 30px;
}
.content1 {
width: 250px;
height: 100%;
background-image: url(https://www.w3schools.com/w3css/img_mountains.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
margin-right: 20px;
}
.content2 {
width: 100%;
height: 100%;
background-color: #dedede;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
}
.content2-img-box {
width: 100%;
height: 280px;
}
.content2-img-box img {
width: 100%;
height: 100%;
object-fit: cover;
}
.content2-info-box {
text-align: center;
}
.content2-info-box p {
margin: 15px 0;
font-size: 1.1rem;
}
.content2-info-box h1 {
margin-bottom: 20px;
}
.content2-info-box button {
font-size: 1.2rem;
padding: 5px 8px;
border-radius: 4px;
outline: none;
cursor: pointer;
border: 1px solid #b5b5b5;
margin-bottom: 10px;
}
#media(max-width: 576px){
.other-content {
flex-direction: column-reverse;
height: auto;
}
.content1 {
width: 100%;
margin-right: 0;
height: 400px;
margin-bottom: 10px;
}
.content2 {
width: 94%;
margin: 10px auto 25px auto;
}
}
<header>
<nav class="navbar container">
<div class="logo-container">
<img src="..." alt="Travel" class="logo-img">
</div>
<div class="list-container">
<ul class="list">
<li class="item">Home</li>
<li class="item">About</li>
<li class="item">Blog</li>
<li class="item">Contact</li>
</ul>
</div>
</nav>
</header>
<main role="main">
<div class="container">
<div class="main-box"></div>
<div class="other-content">
<div class="content1"></div>
<div class="content2">
<div class="content2-img-box">
<img src="https://www.w3schools.com/w3css/img_nature.jpg" alt="">
</div>
<div class="content2-info-box">
<p>Lorem</p>
<h1>Lorem ipsum dolor sit amet consectetur adipisicing.</h1>
<button>Read More</button>
</div>
</div>
</div>
</div>
</main>
Try this:
background-size: 100% auto;
or:
background-size: cover;
Maybe try adding
background-size: cover;
If that doesn't work, maybe try to add a background to the container rather than the header.
I have an unordered list of images with a text overlay at the bottom of each image. The text overlay are inline blocks with different background color.
First I get a whitespace in between the background colors which I do not need. ✔️
Secondly, the left inline block has a fixed width while the right needs to cover up the remaining width ✔️
Thirdly, the second block should have another element which is hidden and ought to show on hover
Lastly I want the two blocks to have an even height at all times when the height of either of them changes
EDIT
Paragraph div needs to show on hover. Also I want the height of the inline blocks to come out even whenever either of them changes.
This is what I have so far
.slideList {
width: 100%;
}
.slideList li {
position:relative;
}
.slideList .service-highlight {
position: absolute;
color: white;
bottom: 0;
left: 0;
right:0
}
.slideList .service-highlight p {
display: inline-block;
color: white;
font-size: 18px;
font-weight: bold;
}
.slideList .service-highlight .services-box{
text-align: center;
background-color: #003768;
width: 200px;
font-weight: bold;
float: left;
}
.slideList .service-highlight .services-detail{
background-color: #0088ff;
width:calc(100% - 200px);
float: left;
padding-left: 5px;
}
.slideList .hide-description {
display: none;
font-weight:normal;
}
.slideList .hide-description p {
font-weight:normal;
padding-top: 10px 5px 10px;
}
.services-detail:hover + .hide-description {
display: block;
position: absolute;
}
.clearFloat {
clear: both;
}
<ul class="slideList">
<li data-transition="fade">
<img src="https://images.unsplash.com/photo-1532274402911-5a369e4c4bb5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80" >
<div class="service-highlight">
<p class="services-box">SOME SERVICE:</p>
<div class="services-detail">
<p>Some headline</p>
<div class="hide-description">
<p>Some text that appears here. Text describes some service I intend to achieve. This may or may not take up to three lines maybe two </p>
</div>
</div>
</div>
</li>
<ul>
1 & 2) The white space can be removed by simply floating .services-box & .service-highlight to the left, and then set the fixed width to .service-box and give a percentage width to .service-highlight.
3) To achieve this, you need to use :hover. However, take note you can't put it on the same line because when you hover, the hidden box appear, and since your mouse is on it, the mouse is on the new box, so it loses its :hover effect and goes back to the original state, thus it will make it blink. So put that new display box above to avoid this.
Hope this helped!
.slideList {
width: 100%;
}
.slideList li {
position:relative;
}
.slideList .service-highlight {
position: absolute;
color: white;
bottom: 0;
left: 0;
right:0
}
.slideList .service-highlight p {
display: inline-block;
color: white;
font-size: 18px;
font-weight: bold;
}
.slideList .service-highlight .services-box{
text-align: center;
background-color: #003768;
width: 200px;
font-weight: bold;
float: left;
}
.slideList .service-highlight .services-detail{
background-color: #0088ff;
width:calc(100% - 202px);
float: left;
}
.slideList .hide-description {
display: none;
}
.services-detail:hover + .hide-description {
display: block;
position: absolute;
bottom: 50px;
}
.clearFloat {
clear: both;
}
<ul class="slideList">
<li data-transition="fade">
<img src="https://images.unsplash.com/photo-1532274402911-5a369e4c4bb5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80" >
<div class="service-highlight">
<p class="services-box">SOME SERVICES:</p>
<p class="services-detail">Service headline detail</p>
<div class="hide-description">
<!-- Div should be a continuation of .services-detail -->
<p>A more detailed description of services. This should appear here. In about 3 sentences and at least three lines long</p>
</div>
<div class="clearFloat"></div>
</div>
</li>
<ul>
UPDATE 2:
From the reference you linked, that is hover on box and not the text. I've changed the markup abit, please take a look now:
* {
margin: 0;
padding: 0;
}
.slideList {
width: 100%;
height: 550px;
background-image: url("https://images.unsplash.com/photo-1532274402911-5a369e4c4bb5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80");
background-repeat: no-repeat;
background-size: cover;
position: relative;
}
.slideList ul {
list-style: none;
}
.service-highlight {
position: absolute;
bottom: 0;
width: 100%;
}
.services-box {
text-align: center;
background-color: #003768;
width: 200px;
font-weight: bold;
float: left;
}
.services-detail {
background-color: #0088ff;
width: calc(100% - 200px);
float: left;
}
.hide-description {
display: none;
}
.slideList:hover .hide-description {
display: block;
position: absolute;
bottom: 0px;
background-color: #0088ff;
}
.clearFloat {
clear: both;
}
<ul class="slideList">
<li data-transition="fade">
<div class="service-highlight">
<p class="services-box">SOME SERVICES:</p>
<p class="services-detail">Service headline detail</p>
<div class="hide-description">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam animi accusamus officia accusantium quaerat distinctio, omnis neque adipisci! Rerum nemo vitae necessitatibus autem fugit ipsam in nam asperiores. Eius, vitae.
</div>
<div class="clearFloat"></div>
</div>
</li>
<ul>
I have 3 li's that I am trying to line up horizontally and then position a span inside each of the li's.
The spans get positioned correctly in Chrome but are well outside the boundary of the li's in Firefox.
http://jsfiddle.net/brendan_rice/mPnCh/1/
Can anyone help please?
<div id="blank-slate-steps">
<ul>
<li class="first">
<h3><em>Step 1</em>Create Something</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</li>
<li class="second">
<h3><em>Step 2</em>Create Something Else</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</li>
<li class="third">
<h3><em>Step 3</em>Create Final Thing</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</li>
</ul>
</div>
CSS
body{
padding-top: 300px;
}
#blank-slate-steps {
background-color: #E8E8E8;
bottom: 0;
font-family: OpenSansCondensedBold,sans-serif;
text-align: center;
width: 100%;
}
#blank-slate-steps li {
display: table-cell;
max-width: 300px;
padding: 40px;
position: relative;
width: 300px;
}
#blank-slate-steps h3 {
font-size: 1.6em;
margin-bottom: 0.6em;
}
#blank-slate-steps h3 em {
color: #878787;
float: left;
font-size: 0.8em;
font-style: normal;
margin-bottom: 4px;
text-transform: uppercase;
width: 100%;
}
#blank-slate-steps li.second span {
background: red url("../images/sprite/icons-grey-38.png") no-repeat scroll 0 -56px transparent;
height: 37px;
width: 36px;
}
#blank-slate-steps span {
background-color: red;
display: block;
height: 20px;
left: -10px;
position: absolute;
top: 50px;
width: 20px;
}
use position relative for blank-slate-steps div.
#blank-slate-steps {
background-color: #E8E8E8;
bottom: 0;
font-family: OpenSansCondensedBold,sans-serif;
text-align: center;
width: 100%;
position: relative;
}
Ok, I've made it work, you can do it like this : fiddle
Explanation: What I did was, I used position: relative; for #blank-slate-steps and than used position: relative; again for div and wrapped the <li> content inside it
HTML
<div id="blank-slate-steps">
<ul>
<li class="first">
<div style="position: relative;">
<h3><em>Step 1</em>Create Something</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</div>
</li>
<li class="second">
<div style="position: relative;">
<h3><em>Step 2</em>Create Something Else</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</div>
</li>
<li class="third">
<div style="position: relative;">
<h3><em>Step 3</em>Create Final Thing</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
<span></span>
</div>
</li>
</ul>
</div>
CSS
body{
padding-top: 300px;
}
#blank-slate-steps {
background-color: #E8E8E8;
bottom: 0;
font-family: OpenSansCondensedBold,sans-serif;
text-align: center;
width: 100%;
position: relative;
}
#blank-slate-steps li {
display: table-cell;
max-width: 300px;
padding: 40px;
width: 300px;
}
#blank-slate-steps h3 {
font-size: 1.6em;
margin-bottom: 0.6em;
}
#blank-slate-steps h3 em {
color: #878787;
float: left;
font-size: 0.8em;
font-style: normal;
margin-bottom: 4px;
text-transform: uppercase;
width: 100%;
}
#blank-slate-steps li.second span {
background: red url("../images/sprite/icons-grey-38.png") no-repeat scroll 0 -56px transparent;
height: 37px;
width: 36px;
}
#blank-slate-steps span {
background-color: red;
display: block;
height: 20px;
left: -10px;
position: absolute;
top: 50px;
width: 20px;
}
Try to put your span in first like that:
<li class="second">
<span></span>
<h3><em>Step 2</em>Create Something Else</h3>
<p>Once you have created Something Else you can Create Final Thing</p>
</li>
and put the span in position:relative and float:left