i everyone!
I need help, I would like the tabs:
tab1 - tab2 - tab3 remained white after clicking, now in my code in hover it turns white, but then everything vanishes.
How can I do with only css, because js does not support me the system?
Any advice and help is welcome!
Thank you all!!
<style>
body {
font-family:"Open Sans";
background:white;
height:300px;
font-size:14px;
}
.tab section {
display:none;
}
.tab section:target, .tab section:last-of-type {
display:block;
}
.tab section:target~section {
display:none;
}
.L1 {
padding:17px;
border:1px solid #2c3e50;
color:white !important;
padding-left:10px;
padding-right:10px;
margin-left:-1px;
}
.L1:hover {
background-color:white;
color:black !important;
border-bottom:1px solid white;
padding:17px;
padding-left:10px;
padding-right:10px;
}
</style>
<section class="tab" style="border:none;background:#1abc9c;max-width:46.5rem;width:100%;margin:5px auto;height:51px;line-height:51px;">
<a class="L1" href="#tab1">tab1</a>
<a class="L1" href="#tab2" style="margin-left:-5px;">tab2</a>
<a class="L1" href="#tab3" style="margin-left:-5px;">tab3</a>
<section id="tab2" style="margin-top:-60px !important;padding-top:61px;">
<span >hello2</span>
</section>
<section id="tab3" style="margin-top:-60px !important;padding-top:61px;">
<span>hello3</span>
</section>
<section id="tab1" style="margin-top:-60px !important;padding-top:61px;">
<span >hello1</span>
</section>
</section>
input, .content {
display: none;
background: #1f7507;
line-height: 25px;
padding: 5px 25px;
color: #fff;
font: normal 1em/150% Sans-Serif;
min-width: 200px;
}
#one:checked ~ .one,
#two:checked ~ .two,
#three:checked ~ .three {display: block;}
label {
cursor: pointer;
background: #999;
height: 25px;
padding: 5px 10px;
display: inline-block;
text-align: center;
color: #fff;
font: normal 1em/150% Sans-Serif;
margin-right: -3px;
transition: background .25s linear;
}
label:hover, input:checked + label {background: #1f7507;}
h3, p {
text-indent: 25px;
text-align: justify;
}
<input type="radio" name="nav" id="one" checked="checked"/>
<label for="one">tab 1</label>
<input type="radio" name="nav" id="two"/>
<label for="two">tab 2</label>
<input type="radio" name="nav" id="three"/>
<label for="three">tab 3</label>
<article class="content one">
<h3>sample 1</h3>
<p>heyyy</p>
</article>
<article class="content two">
<h3>sample 2</h3>
<p>howdy</p>
</article>
<article class="content three">
<h3>sample 3</h3>
<p>hello</p>
</article>
Why doesn't the text/block display when I hover over the image? I have the html/css provided below. I really dont't know why it doesn't display when I hover over the image. (I'm just trying to hover over the first image out of the four displayed)
This is the particular relevant css snippet that I tried to use to hover over the image and display text:
/* HOVER STYLES */
div#pop-up1, #pop-up2, #pop-up3, #pop-up4 {
visibility: hidden;
position: absolute;
width: 280px;
padding: 10px;
background: #eeeeee;
color: #000000;
border: 3px solid #196CE8; /*#f7923a;*/
font-size: 90%;
border-radius: 25px;
}
trigger1:hover #pop-up1 {
display: block;
opacity: 1;
}
This is the particular html snippet:
<section id="promo_area">
<article>
<div class="inner">
<div class="picDiv"><span id="trigger1"><img alt="paris" src="Paris.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up1">
<h3>Paris</h3>
<p>MUN in Paris 2013.</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger2"><img alt="Russia" src="russia.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up2">
<h3>Russia</h3>
<p>MUN in Russia 2014</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger3"><img alt="Dubai" src="dubai.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up3">
<h3>Dubai</h3>
<p>MUN in Dubai 2015</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger4"><img alt="Japan" src="japan.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up4">
<h3>Japan</h3>
<p>MUN in Japan 2016</p>
</div>
</article>
</section><!--end promo_area-->
This is the full code:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Birdwatching</title>
<!-- <link rel="stylesheet" href="style.css"> -->
<style>
html
{ height: 100%;
}
*
{ margin: 0;
padding: 0;}
body
{ font: normal .80em 'trebuchet ms', arial, sans-serif;
background: #F0EFE2 url(ff.jpg) repeat;
color: #000;
width: 97%;
min-width: 800px;
margin:0 auto;
}
p
{ padding: 0 0 20px 0;
line-height: 1.7em;}
img
{ border: 0;}
h1, h2, h3, h4, h5, h6
{ font: normal 175% 'century gothic', arial, sans-serif;
color: #7E2451;
margin: 0 0 15px 0;
padding: 15px 0 5px 0;}
h2
{ font: normal 175% 'century gothic', arial, sans-serif;}
h4, h5, h6
{ margin: 0;
padding: 0 0 5px 0;
font: normal 120% arial, sans-serif;}
h5, h6
{ font: italic 95% arial, sans-serif;
padding: 0 0 15px 0;}
nav ul {
background: url(transparent.png) ;
width: 100%;
height: 52px;
text-align: center;
padding: 0;
margin: 0;
}
nav ul li {
display: inline;
}
nav ul li a {
text-decoration: none;
color: #fff;
letter-spacing: 0.2em;
font: normal 100% arial, sans-serif;
text-align: center;
display: inline-block;
margin: 5px;
padding: 9px 26px 9px 26px;
text-transform: uppercase;
}
nav ul li a:hover {
color: #000;
background-color: #fff;
}
.dropdown {
display:inline-block;
position: relative;
}
.dropdown-content {
background: #f9f9f9;
min-width: 160px;
position: absolute;
display: none;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
left: 50%;
transform: translateX(-50%);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align:left;
}
.dropdown-content a:hover {
background: #bada55;
left:auto;
right:0;
margin-right:-10px;
}
.dropdown:hover .dropdown-content {
display: block;
}
main
{ width: 854px;
overflow: hidden;
margin: 0 auto 0 auto;
padding: 0 24px 20px 20px;
background: transparent url(transparent_light.png) repeat;}
#first_half article
{ text-align: left;
float: left;
width: 595px;
/width:60%;
height: 50pc;
padding: 0;}
#first_half article ul
{ margin: 2px 0 22px 0px;}
#first_half article ul li
{ list-style-type: none;
background: url(bullet.png) no-repeat;
margin: 0 0 6px 0;
padding: 0 0 4px 25px;
line-height: 1.5em;}
#first_half aside
{ float: right;
width: 210px;
/width: 25%;
/padding: 0 15px 20px 15px;
padding: 0;
height: 50pc;
}
#first_half aside ul
{ width: 198px;
padding: 4px 0 0 0;
margin: 4px 0 30px 0;}
#first_half aside li
{ list-style: none;
padding: 0 0 7px 0; }
#first_half aside li a, #first_half .sidebar li a:hover
{ padding: 0 0 0 40px;
display: block;
background: transparent url(link.png) no-repeat left center;}
#first_half aside li a.selected
{ color: #7E2451;
text-decoration: none;}
#promo_area article {
float:left;
width: 25%;
/height: 50pc;
padding:10px 0;
border-top: solid #f7be84;
/background:#fff;
text-align: center;
}
#promo_area article .inner {
margin:0 10px;
padding:10px;
background:#e5e8ed;
/border-radius: 25px;
box-shadow: 10px 10px 5px #888888;
text-align: center;
}
#promo_area article p {
font-family:'Open Sans Condensed';
font-weight:300;
font-size:1em;
line-height:1.5em;
color:#616161;
}
/* HOVER STYLES */
div#pop-up1, #pop-up2, #pop-up3, #pop-up4 {
visibility: hidden;
position: absolute;
width: 280px;
padding: 10px;
background: #eeeeee;
color: #000000;
border: 3px solid #196CE8; /*#f7923a;*/
font-size: 90%;
border-radius: 25px;
}
trigger1:hover #pop-up1 {
display: block;
opacity: 1;
}
</style>
</head>
<body>
<header>
<h1>Model United Nations Deforestation Conference</h1>
<img src="dove.png" alt="a simple dove logo">
<nav>
<ul>
<li>Home</li>
<li class="dropdown">Get started
<div class="dropdown-content">
Preparation
D-Day
Useful Resources
</div>
</li>
<li class="dropdown">Gallery
<div class="dropdown-content">
MUN 2015
MUN 2016
MUN 2017
</div>
</li>
<li class="dropdown">Contact Us
<div class="dropdown-content">
Ask A Question
Contact Information
Map
</div>
</li>
<li class="dropdown">Forum
<div class="dropdown-content">
About
Sign-Up
Community
</div>
</li>
</ul>
</nav>
</header>
<main>
<section id = "first_half">
<article>
<h2>Welcome</h2>
<p>Welcome to our fake birdwatching site. If this were a real site, it would be the ideal place to come to learn more about birdwatching, whether you are a beginner looking to learn how to get into birding, or an expert wanting to share ideas, tips, and photos with other like-minded people.</p>
<p>So don't waste time! Get what you need, then turn off that computer and get out into the great outdoors!</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/ojcNcvb1olg" frameborder="0" allowfullscreen sandbox></iframe>
<h2>Rocking the free web</h2>
<p>Mozilla are a global community of technologists, thinkers, and builders, working together to keep the Internet alive and accessible, so people worldwide can be informed contributors and creators of the Web. We believe this act of human collaboration across an open platform is essential to individual growth and our collective future.</p>
<p>Click on the images below to find more information about the cool stuff Mozilla does. Red panda picture by Mathias Appel.</p>
</article>
<aside>
<form>
<h1>Payment form</h1>
<p>Required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p>
<section>
<h2>Contact information</h2>
<fieldset>
<legend>Title</legend>
<ul>
<li>
<label for="title_1">
<input type="radio" id="title_1" name="title" value="M." >
Mister
</label>
</li>
<li>
<label for="title_2">
<input type="radio" id="title_2" name="title" value="Ms.">
Miss
</label>
</li>
</ul>
</fieldset>
<p>
<label for="name">
<span>Name: </span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="text" id="name" name="username">
</p>
<p>
<label for="mail">
<span>E-mail: </span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="email" id="mail" name="usermail">
</p>
<p>
<label for="pwd">
<span>Password: </span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="password" id="pwd" name="password">
</p>
</section>
<section>
<h2>Payment information</h2>
<p>
<label for="card">
<span>Card type:</span>
</label>
<select id="card" name="usercard">
<option value="visa">Visa</option>
<option value="mc">Mastercard</option>
<option value="amex">American Express</option>
</select>
</p>
<p>
<label for="number">
<span>Card number:</span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="text" id="number" name="cardnumber">
</p>
<p>
<label for="date">
<span>Expiration date:</span>
<strong><abbr title="required">*</abbr></strong>
<em>formatted as mm/yy</em>
</label>
<input type="text" id="date" name="expiration">
</p>
</section>
<p> <button type="submit">Validate the payment</button> </p>
</form>
</aside>
</section>
<section id="promo_area">
<article>
<div class="inner">
<div class="picDiv"><span id="trigger1"><img alt="paris" src="Paris.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up1">
<h3>Paris</h3>
<p>MUN in Paris 2013.</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger2"><img alt="Russia" src="russia.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up2">
<h3>Russia</h3>
<p>MUN in Russia 2014</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger3"><img alt="Dubai" src="dubai.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up3">
<h3>Dubai</h3>
<p>MUN in Dubai 2015</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger4"><img alt="Japan" src="japan.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up4">
<h3>Japan</h3>
<p>MUN in Japan 2016</p>
</div>
</article>
</section><!--end promo_area-->
</main>
</body>
</html>
First of all the css code you used to display it is not correct trigger1:hover #pop-up1 , as per you requirement i placed a simple css at the bottom , where + is used for the Adjacent sibling combinator
#promo_area article .inner:hover + div {
display: block;
visibility: visible;
}
html
{ height: 100%;
}
*
{ margin: 0;
padding: 0;}
body
{ font: normal .80em 'trebuchet ms', arial, sans-serif;
background: #F0EFE2 url(ff.jpg) repeat;
color: #000;
width: 97%;
min-width: 800px;
margin:0 auto;
}
p
{ padding: 0 0 20px 0;
line-height: 1.7em;}
img
{ border: 0;}
h1, h2, h3, h4, h5, h6
{ font: normal 175% 'century gothic', arial, sans-serif;
color: #7E2451;
margin: 0 0 15px 0;
padding: 15px 0 5px 0;}
h2
{ font: normal 175% 'century gothic', arial, sans-serif;}
h4, h5, h6
{ margin: 0;
padding: 0 0 5px 0;
font: normal 120% arial, sans-serif;}
h5, h6
{ font: italic 95% arial, sans-serif;
padding: 0 0 15px 0;}
nav ul {
background: url(transparent.png) ;
width: 100%;
height: 52px;
text-align: center;
padding: 0;
margin: 0;
}
nav ul li {
display: inline;
}
nav ul li a {
text-decoration: none;
color: #fff;
letter-spacing: 0.2em;
font: normal 100% arial, sans-serif;
text-align: center;
display: inline-block;
margin: 5px;
padding: 9px 26px 9px 26px;
text-transform: uppercase;
}
nav ul li a:hover {
color: #000;
background-color: #fff;
}
.dropdown {
display:inline-block;
position: relative;
}
.dropdown-content {
background: #f9f9f9;
min-width: 160px;
position: absolute;
display: none;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
left: 50%;
transform: translateX(-50%);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align:left;
}
.dropdown-content a:hover {
background: #bada55;
left:auto;
right:0;
margin-right:-10px;
}
.dropdown:hover .dropdown-content {
display: block;
}
main
{ width: 854px;
overflow: hidden;
margin: 0 auto 0 auto;
padding: 0 24px 20px 20px;
background: transparent url(transparent_light.png) repeat;}
#first_half article
{ text-align: left;
float: left;
width: 595px;
/width:60%;
height: 50pc;
padding: 0;}
#first_half article ul
{ margin: 2px 0 22px 0px;}
#first_half article ul li
{ list-style-type: none;
background: url(bullet.png) no-repeat;
margin: 0 0 6px 0;
padding: 0 0 4px 25px;
line-height: 1.5em;}
#first_half aside
{ float: right;
width: 210px;
/width: 25%;
/padding: 0 15px 20px 15px;
padding: 0;
height: 50pc;
}
#first_half aside ul
{ width: 198px;
padding: 4px 0 0 0;
margin: 4px 0 30px 0;}
#first_half aside li
{ list-style: none;
padding: 0 0 7px 0; }
#first_half aside li a, #first_half .sidebar li a:hover
{ padding: 0 0 0 40px;
display: block;
background: transparent url(link.png) no-repeat left center;}
#first_half aside li a.selected
{ color: #7E2451;
text-decoration: none;}
#promo_area article {
float:left;
width: 25%;
/height: 50pc;
padding:10px 0;
border-top: solid #f7be84;
/background:#fff;
text-align: center;
}
#promo_area article .inner {
margin:0 10px;
padding:10px;
background:#e5e8ed;
/border-radius: 25px;
box-shadow: 10px 10px 5px #888888;
text-align: center;
}
#promo_area article p {
font-family:'Open Sans Condensed';
font-weight:300;
font-size:1em;
line-height:1.5em;
color:#616161;
}
/* HOVER STYLES */
div#pop-up1, #pop-up2, #pop-up3, #pop-up4 {
visibility: hidden;
position: absolute;
width: 280px;
padding: 10px;
background: #eeeeee;
color: #000000;
border: 3px solid #196CE8; /*#f7923a;*/
font-size: 90%;
border-radius: 25px;
}
trigger1:hover #pop-up1 {
display: block;
opacity: 1;
}
#promo_area article .inner:hover + div {
display: block;
visibility: visible;
}
<header>
<h1>Model United Nations Deforestation Conference</h1>
<img src="dove.png" alt="a simple dove logo">
<nav>
<ul>
<li>Home</li>
<li class="dropdown">Get started
<div class="dropdown-content">
Preparation
D-Day
Useful Resources
</div>
</li>
<li class="dropdown">Gallery
<div class="dropdown-content">
MUN 2015
MUN 2016
MUN 2017
</div>
</li>
<li class="dropdown">Contact Us
<div class="dropdown-content">
Ask A Question
Contact Information
Map
</div>
</li>
<li class="dropdown">Forum
<div class="dropdown-content">
About
Sign-Up
Community
</div>
</li>
</ul>
</nav>
</header>
<main>
<section id = "first_half">
<article>
<h2>Welcome</h2>
<p>Welcome to our fake birdwatching site. If this were a real site, it would be the ideal place to come to learn more about birdwatching, whether you are a beginner looking to learn how to get into birding, or an expert wanting to share ideas, tips, and photos with other like-minded people.</p>
<p>So don't waste time! Get what you need, then turn off that computer and get out into the great outdoors!</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/ojcNcvb1olg" frameborder="0" allowfullscreen sandbox></iframe>
<h2>Rocking the free web</h2>
<p>Mozilla are a global community of technologists, thinkers, and builders, working together to keep the Internet alive and accessible, so people worldwide can be informed contributors and creators of the Web. We believe this act of human collaboration across an open platform is essential to individual growth and our collective future.</p>
<p>Click on the images below to find more information about the cool stuff Mozilla does. Red panda picture by Mathias Appel.</p>
</article>
<aside>
<form>
<h1>Payment form</h1>
<p>Required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p>
<section>
<h2>Contact information</h2>
<fieldset>
<legend>Title</legend>
<ul>
<li>
<label for="title_1">
<input type="radio" id="title_1" name="title" value="M." >
Mister
</label>
</li>
<li>
<label for="title_2">
<input type="radio" id="title_2" name="title" value="Ms.">
Miss
</label>
</li>
</ul>
</fieldset>
<p>
<label for="name">
<span>Name: </span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="text" id="name" name="username">
</p>
<p>
<label for="mail">
<span>E-mail: </span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="email" id="mail" name="usermail">
</p>
<p>
<label for="pwd">
<span>Password: </span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="password" id="pwd" name="password">
</p>
</section>
<section>
<h2>Payment information</h2>
<p>
<label for="card">
<span>Card type:</span>
</label>
<select id="card" name="usercard">
<option value="visa">Visa</option>
<option value="mc">Mastercard</option>
<option value="amex">American Express</option>
</select>
</p>
<p>
<label for="number">
<span>Card number:</span>
<strong><abbr title="required">*</abbr></strong>
</label>
<input type="text" id="number" name="cardnumber">
</p>
<p>
<label for="date">
<span>Expiration date:</span>
<strong><abbr title="required">*</abbr></strong>
<em>formatted as mm/yy</em>
</label>
<input type="text" id="date" name="expiration">
</p>
</section>
<p> <button type="submit">Validate the payment</button> </p>
</form>
</aside>
</section>
<section id="promo_area">
<article>
<div class="inner">
<div class="picDiv"><span id="trigger1"><img alt="paris" src="Paris.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up1">
<h3>Paris</h3>
<p>MUN in Paris 2013.</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger2"><img alt="Russia" src="russia.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up2">
<h3>Russia</h3>
<p>MUN in Russia 2014</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger3"><img alt="Dubai" src="dubai.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up3">
<h3>Dubai</h3>
<p>MUN in Dubai 2015</p>
</div>
</article>
<article>
<div class="inner">
<div class="picDiv"><span id="trigger4"><img alt="Japan" src="japan.jpg" width="100" height="100" /></span></div>
</div>
<!-- HIDDEN / POP-UP DIV -->
<div id="pop-up4">
<h3>Japan</h3>
<p>MUN in Japan 2016</p>
</div>
</article>
</section><!--end promo_area-->
</main>
I've built a modified tab-chart. When you click on the tabs on the left hand side, they switch the content on the right. The only problem is the main content div on the right, even with a width of 100% is only going about a third of the way across the screen. Any ideas why?
* {
padding: 0;
margin: 0;
}
#container {
display: block;
height: 100%;
width: 100%;
}
#topBar1 {
height: 55px;
width: 100%;
background-color: #FAFAFA;
border-bottom: 1px solid #d9d9d9;
display: block;
position: relative;
z-index: 2;
}
#topBar2 {
height: 22px;
width: 100%;
background-color: #FAFAFA;
display: block;
border-radius: 11%;
box-shadow: 0 6px 10px -2.5px #ccc;
position: relative;
z-index: 2;
transition: all;
}
main {
display: block;
background-color: #EEEEEE;
height: 1000px;
width: 100%;
position: relative;
z-index: 1;
top: -5px;
}
nav {
height: 100%;
width: 261px;
}
nav::after {
height: 100%;
width: 1px;
content: "";
display: block;
background: #d9d9d9;
position: relative;
left: 260px;
top: -1000px;
}
input[type=radio] {
display: none;
}
.tabs {
list-style: none;
position: relative;
//border: 1px solid #ccc;
width: 260px;
height: 100%;
top: 15px;
}
.tabs li {
font-family: Roboto, sans-serif;
font-size: 13px;
padding: 10px 20px 20px 60px;
color: #222222;
//border: 1px solid #ccc;
background-color: none;
transition: all .2s ease-in-out;
}
.tabs li:hover {
background-color: #d9d9d9;
}
.tabs li:active {
background-color: #d9d9d9;
}
.tabs label {
display: block;
position: relative;
cursor: pointer;
top: 6px;
}
.tab-content {
position: absolute;
display: none;
z-index: 2;
height: 100%;
width: 100%;
left: 261px;
top: 0;
border: 1px solid #ccc;
}
[id^=tab]:checked~[class^=tab-content] {
display: block;
}
.contentItem {
//border: 1px solid #ccc;
height: 38px;
width: 200px;
margin-left: 10px;
margin-top: 10px;
margin-bottom: 20px;
margin-left: 10px;
background-color: #FAFAFA;
box-shadow: .5px 2px 6px #ccc;
float: left;
}
.documentIcon {
height: 30px;
width: 30px;
border: 1px solid #ccc;
margin: 3px;
margin-left: 5px;
margin-right: 10px;
float: left;
}
.contentText {
font-family: Roboto, sans-serif;
font-size: 12px;
color: #222222;
line-height: 3;
}
<div id="container">
<div id="topBar1"></div>
<!--topBar-->
<div id="topBar2"></div>
<!--topBar2-->
<main>
<nav>
<ul class="tabs">
<li>
<input type="radio" name="tabs" id="tab-1" checked />
<label for="tab-1">Staff Directory</label>
<div class="tab-content" id="tab-content-1">
<div class="contentItem" id="ci1">
<img src="" alt="" class="documentIcon" />
<p class="contentText">Telephone Extension List</p>
</div>
</div>
<!--tab-content-->
</li>
<li>
<input type="radio" name="tabs" id="tab-2" />
<label for="tab-2">How-To Guides</label>
<div class="tab-content" id="tab-content-2">
<p>Put Tab 2 Content here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-3" />
<label for="tab-3">OECTA Calendar</label>
<div class="tab-content" id="tab-content3">
<p>Put tab content 3 here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-4" />
<label for="tab-4">Finance</label>
<div class="tab-content" id="tab-content-4">
<p>Put tab content for 4 here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-5" />
<label for="tab-5">Directories and Contact Lists</label>
<div class="tab-content" id="tab-content-5">
<p>Put Tab 5 content here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-6" />
<label for="tab-6">Upcoming Meetings</label>
<div class="tab-content" id="tab-content-6">
<p>Put tab 6 content here</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-7" />
<label for="tab-7">Manuals and Handbooks</label>
<div class="tab-content" id="tab-content-7">
<p>Tab Content 7</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-8" />
<label for="tab-8">Information and Forms</label>
<div class="tab-content" id="tab-content-8">
<p>Tab Content 8</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab-9" />
<label for="tab-9">Visitor Information</label>
<div class="tab-content" id="tab-content-9">
<p>Tab Content 9</p>
</div>
</li>
</ul>
</nav>
</main>
</div>
You looking for something like this? https://jsfiddle.net/csgn6051/9/
.tabs
{
width: calc(100% - 270px);
}
First off let me say, I don't do a whole lot of front end design so please excuse all my inline code etc...
I've built these check boxes to be able to include the image when clicked. I understand it's not inside the parent class but i'm a bit confused at this point on how to move forward. Since it doesn't have a parent class it just looks for the whole web page as it's parent class i presume.
Fairly simple, i think; when i minimize my screen my label positioning removes itself from the boxes and floats off. I'll attach screen shots for more clarity.
I've tried to put a few of them in divs with some success but i'm not 100% sure the right way of doing this and that's why i'm here. I've tried some relative positioning as well.
<div class="interests">
<div class="subHeader">Interests:</div>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 465px; top: 1105px;"><div style="position:relative;left:10px; bottom: 8px;">SKATE</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 685px; top: 1105px;"><div style="position:relative;left:10px; bottom: 8px;">SURF</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 906px; top: 1105px;"><div style="position:relative;left:10px; bottom: 8px;">SNOW</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 465px; top: 1300px;"><div style="position:relative;left:10px; bottom: 8px;"> WOMEN</div></label>
<label style="background-color: #000; color:#fff; width:160px; font-family: 'itc_avant_garde_gothic_ltbold';
font-size: 18px !important;
text-transform: uppercase;
color: #FFF;
padding-top: 20px;
display: inline-block; z-index: 5; position:absolute; left: 685px; top: 1300px;"><div style="position:relative;left:10px; bottom: 8px;"> MUSIC/ART </div></label>
<label style="position: relative; top: 90px;">
<input type="checkbox" name="CheckBox.A address.Sk" style="z-index: 1;position: relative; top:4px;">Skate<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width: 205px;">
</label>
<input type="hidden" name="CheckBox.A address.Sk" value="off">
<label style="position: relative; left:140px; top: 90px;">
<input type="checkbox" name="CheckBox.A address.Su" style="z-index: 1;position: relative; top:4px;">Surf<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width: 205px;">
</label>
<input type="hidden" name="CheckBox.A address.Su" value="off">
<label style="position: relative; left:290px; top: 90px;">
<input type="checkbox" name="CheckBox.A address.Sn" style="z-index: 1;position: relative; top:4px;">Snow<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width:205px;">
</label>
<input type="hidden" name="CheckBox.A address.Sn" value="off">
<br><br><br><br><br><br><br><br><br><br><br><br>
<label style="position:relative; top: 60px;">
<input type="checkbox" name="CheckBox.A address.Wo" style="z-index: 1;position: relative; top:4px;">Women<img src="https://stuff/Images/thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width:205px;">
</label>
<input type="hidden" name="CheckBox.A address.Wo" value="off">
<label style="position:relative; left: 130px; top: 60px;">
<input type="checkbox" name="CheckBox.A address.Mu" style="z-index: 1;position: relative; top:4px;">Music<img src="https://stuff/Images/music_thumb.jpg" style="position: absolute;left: 0;bottom: 0;height: 185px;width:205px;">
</label><input type="hidden" name="CheckBox.A address.Mu " value="off">
<label><input type="checkbox" name="CheckBox.A address.Subscribe"></label>
<div style="position:relative; left: 50px; bottom: 33px;">Subscribe</div>
<input type="hidden" name="CheckBox.A address.Subscribe" value="off">
<input type="submit" id="submit" value="Sign Up" style="width: 280px;
height: 45px;
display: block !important;
outline-style: none !important;
outline-width: 0px !important;
color: #fff !important;
font-weight: normal !important;
font-family: 'itc_avant_garde_gothic_ltbold';
text-transform: uppercase;
text-decoration: none;
text-align: center;
border: 1px solid #434242;
background-color: #434242;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#434242), to(#2f2e2e));
background-image: -webkit-linear-gradient(top, #434242, #2f2e2e);
background-image: -moz-linear-gradient(top, #434242, #2f2e2e);
background-image: -ms-linear-gradient(top, #434242, #2f2e2e);
background-image: -o-linear-gradient(top, #434242, #2f2e2e);
-moz-box-shadow: 0 0 1px #bbb;
-webkit-box-shadow: 0 0 1px #bbb;
box-shadow: 0 0 1px #bbb;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
vertical-align: middle;
padding: 10px 0;
line-height: 1em;
cursor: pointer;
line-height: 18px;
font-size: 18px;
margin: 40px 0;">
</div>
Any help would be greatly appreciated. Thank you. Screen shots below.
Labels are floating off when i minimize :
Works fine when full screen :
I commented with a few bad practices and falsehoods on another answer, so I really had to make a quick example myself, this is one way to do it with flexbox (there are a lot of solutions to this problem, this is a good one if you don't have to support obsolete browsers):
Example: https://jsfiddle.net/um6fm744/1/
CSS:
* { box-sizing: border-box; margin: 0; padding: 0; }
.interests {
display: flex;
flex-wrap: wrap;
}
.sub-header {
margin: 0 0 24px;
width: 100%;
}
.interest {
align-items: flex-end;
background-color: green;
display: flex;
margin: 0 12px 24px 0;
min-height: 160px;
width: 160px;
}
.interest-info {
background-color: black;
display: flex;
justity-content: space-between;
width: 100%;
}
.interest-checkbox {
height: 30px;
width: 30px;
}
.interest-label {
color: white;
font-family: sans-serif;
flex: 1;
height: 30px;
line-height: 30px;
margin-left: 12px;
}
HTML
<div class="interests">
<h1 class="sub-header">Interests:</h1>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">SKATE</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">SNOW</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">WOMEN</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">SURF</label>
</div>
</div>
<div class="interest">
<div class="interest-info">
<input class="interest-checkbox" type="checkbox" />
<label class="interest-label">MUSIC/ART</label>
</div>
</div>
</div>
Please don't use inline styling.
I would tackle it more like this: http://codepen.io/anon/pen/VeEXEv
HTML:
<ul class="items">
<li class="item1">
<button class="add-button">+</button>
<span class="description">box 1</span>
</li>
<li class="item2">
<button class="add-button">+</button>
<span class="description">box 2</span>
</li>
<li class="item3">
<button class="add-button">+</button>
<span class="description">box 3</span>
</li>
<li class="item2">
<button class="add-button">+</button>
<span class="description">box 2</span>
</li>
<li class="item3">
<button class="add-button">+</button>
<span class="description">box 3</span>
</li>
<li class="item1">
<button class="add-button">+</button>
<span class="description">box 1</span>
</li>
</ul>
CSS:
.items > li {
list-style: none;
float: left;
height: 20px;
width: 100px;
margin: 10px;
border: 1px #000 solid;
position: relative;
padding-top: 80px;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
.items .description {
background: rgba(0,0,0,0.8);
height: 20px;
width: 80px;
color: #fff;
display: block;
float: right;
text-align: center;
}
.items .add-button {
width: 20px;
height: 20px;
border: none;
background-color: #666;
color: #fff;
}
.item1 {
background-image: url(https://pbs.twimg.com/profile_images/586137164188004352/wTK4hjbl.jpg);
}
.item2 {
background-image: url(https://pbs.twimg.com/profile_images/3276050019/f1d244a9f3254f30176922985c761d28.png);
}
.item3 {
background-image: url(https://people.rit.edu/~bmd6715/230/exercises/images/cat.png);
}
So, I added a customized live tweet feature to the website, using something called 'twitter-post-fetcher, and I'm trying to get rid of this random bullet-point next to the live tweet. I tried adding it 'list-style'but that doesn't seem to be working.
Thanks in advance.
<!-- Custom CSS -->
<link href="css/customstyle.css" rel="stylesheet">
<style type="text/css">
.border{
border-right:1px solid #000;
}
footer{
margin-top: 300px;
}
.audio-peri-soc{
width:190%;
line-height: 45px;
}
.social-media{
display: block;
}
.unstyled{
list-style-type: none;
}
.border{
border-right:2px solid #ccc;
height:100px;
}
.col-lg-4{
width:30%;
list-style-type: none;
}
.compress .col-xs-9{
width: 200%;
padding-left: none;
}
.compress .col-xs-4{
padding-left:0;
}
.compress .col-lg-8 div{
margin:0;
padding: 0;
color:black;
font-size: 15px;
width:100%;
}
.blue{
color:#fff;
bottom:0;
margin-top:-10px;
margin-left: 10px;
font-size: 10px;
}
.compress{
width:100%;
margin: 0;
}
.twitter-fav-icon{
margin-left: 5px;
}
.compress p, a {
font-family:Arial,Sans-Serif;
font-size:13px;
color:black;
text-decoration:none;
margin: 0;
}
.compress ul li {
list-style:none;
overflow:hidden;
margin:50px;
padding:5px;
width:100%;
}
#example1{
margin-left: -40px;
padding: 0;
list-style-type: none;
}
.interact a{
margin: 0 0 0 5px;
padding: 0;
text-decoration: none;
}
.compress ul li:hover {
background-color:#fff;
}
.compress .user, .tweet, .timePosted {
float:none;
}
.compress a, a:visited {
color:#999;
}
.compress a:hover {
color:#ccc;
}
body{background:url('http://www.placehold.it/1200x800/cccccc/000000') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
margin: 0;}
.effect{
-moz-box-shadow: inset 0 0 10px #000000;
-webkit-box-shadow: inset 10px 100px 0 #000000;
box-shadow: inset 1px 0 10px #000000;
}
.col-md-7 p{
font-size:15px;
line-height: 230%;
text-align: justify;
width: 500px;
margin-top: -30px;
}
#footerSlideButton {
background-image:url('http://placehold.it/50x50');
background-repeat:none;
position: absolute;
top: -55px;
right: 20px;
width:50px;
height:50px;
border: none;
cursor: pointer;
}
.container .pull-left p{
margin: 0;
color:blue;
padding:0;
}
.navbar-fixed-bottom p{
margin: 20px;
font-size: 15px;
}
.navbar-fixed-bottom {
position: fixed;
bottom: -20px;
height: 0;
width: 100%;
background-color:#ffffff;
padding: 10px 0;
margin: 0;
}
#media (max-width:630px) {
ul{
color: blue;
}
}
</style>
</head>
<body>
<footer>
<div class="container" id="contact" name="contact">
<div class="row">
<br>
<h1 class="centered">THANKS FOR VISITING US</h1>
<hr>
<div class="col-lg-4">
<h3>Latest Tweets
</h3>
<div id="example1"></div>
<h4>Watch me on Periscope</h4>
<script>...</script>...
</div><!-- col -->
<div class="col-lg-4 border">
<form class="form-horizontal" role="form">
<div class="form-group">
</div>
</form><!-- form -->
</p>
</div><!-- col -->
<div class="col-lg-4">
<h3> Subscribe
</h3>
<div id="example1"></div>
<p>Subscribe for the latest newsletters and updates</p>
<div id="mc_embed_signup" class="mailchimp">
<div class="form-group">
<input type="email" value="" name="EMAIL" class="required email form-control" id="mce-EMAIL" placeholder="Enter email">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn btn__bottom--border mailchimp__btn" data-style="shrink" data-horizontal>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<div class="" style="position: absolute; left: -5000px;"><input type="text" name="..." value=""></div>
</form>
<span class="form_nospam">No spam</span>
</div><!--End mc_embed_signup-->
</div><!-- col -->
</div><!-- row -->
</div><!-- container -->
<hr class="container">
<div class="container">
<i class="fa fa-facebook fa-2x"></i>
<i class="fa fa-twitter fa-2x"></i>
<i class="fa fa-soundcloud fa-2x"></i>
<div class="pull-right">
<iframe width="60%" height="20" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/226657681&color=999999&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false"> </iframe>
</div>
</div>
</footer>
</body>
</html>
Assuming you want no bullet points at all.
* {
list-style-type: none;
}