So I am trying to align the toggle button I'm creating using CSS to be aligned with the 'paragraph description' as I'd like to call it but I can't seem to make it look the way I wanted it to look. I've not only provided a wireframe but a jsfiddle as well.
HTML code:
<p id="displayOption">Display Options</p>
<div id="onoffSwitch">
<ul id="btn" class="btn">
<li class="display-title" id="spoilers">
<span id="spoilerSwitch">Show/Hide Spoilers:</span>
<ul class="selector">
<li class="on">
<span class="onoffswitch-inner">
</li>
<li class="off">
<span class="onoffswitch-switch"></span></span>
</li>
</ul>
</li>
<li class="display-title" id="day-night">
<span id="day-nightSwitch">Day or Night Vision:</span>
<ul class="selector">
</ul>
</ul>
</div>
CSS code:
/***** options *****/
#displayOption {
text-align: center;
font-family: "Comic Sans MS", cursive, sans-serif;
border: .88px #efdaae;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
/*-moz-border-radius: 10px;
-webkit-border-radius: 10px;*/
width: 258px;
background-color: #945e38;
padding: .1px;
margin: 0px;
font-variant: small-caps;
font-size: 1.5em;
color: #fdfdfa;
}
#displayOption-invert {
text-align: center;
font-family: "Comic Sans MS", cursive, sans-serif;
border: .88px #efdaae;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
/*-moz-border-radius: 10px;
-webkit-border-radius: 10px;*/
width: 258px;
background-color: #efdaae;
padding: .1px;
margin: 0px;
font-variant: small-caps;
font-size: 1.5em;
color: #030303;
}
#onoffSwitch {
font-family: "Comic Sans MS", cursive, sans-serif;
border: 1px solid #945e38;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
padding: 7px 10px;
line-height: normal;
text-align: left;
padding-bottom: 18px;
color: #000000;
}
#onoffSwitch-invert {
font-family: "Comic Sans MS", cursive, sans-serif;
border: 1px solid #efdaae;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
padding: 7px 10px;
line-height: normal;
text-align: left;
padding-bottom: 18px;
color: #ffffff;
}
/*** unordered list ***/
#btn, #btn ul {
padding: 0px;
margin: 0px;
list-style-type: none; /*bullet removel*/
list-style: none; /*bullet removel*/
text-decoration: none; /*bullet removel*/
}
.display-title {
display: inline-block;
}
/*** text ***/
#spoilerSwitch, #daynightVision {
font-family: "Comic Sans MS", cursive, sans-serif;
line-height: normal;
color: #000000;
text-align: left;
margin-bottom: 10px;
}
#spoilerSwitch-invert, #daynightVision-invert {
font-family: "Comic Sans MS", cursive, sans-serif;
line-height: normal;
color: #FFFFFF;
text-align: left;
margin-bottom: 10px;
}
/*** toggle button ***/
.onoffswitch {
position: relative;
width: 50px;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select: none;
}
.onoffswitch-checkbox {
display: none;
}
.onoffswitch-label, .onoffswitchInvert-label {
display: block;
overflow: hidden;
cursor: pointer;
border: 2px solid #999999;
border-radius: 0px;
}
.onoffswitch-inner, .offswitchInvert-inner {
display: block;
width: 200%;
margin-left: 100%;
transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
display: block;
float: left;
width: 50%;
height: 30px;
padding: 0;
line-height: 26px;
font-size: 14px;
color: white;
font-family: Trebuchet, Arial, sans-serif;
font-weight: bold;
box-sizing: border-box;
border: 2px solid transparent;
background-clip: padding-box;
}
.onoffswitch-inner:before {
content: "";
padding-left: 10px;
background-color: #2E8DEF;
color: #FFFFFF;
}
.onoffswitch-inner:after {
content: "";
padding-right: 10px;
background-color: #CCCCCC; color: #333333;
text-align: right;
}
.onoffswitch-switch {
display: block;
width: 25px;
margin: 0px;
background: #000000;
position: absolute;
top: 0;
bottom: 0;
right: 65px;
transition: all 0.3s ease-in 0s;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
margin-left: 0;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
right: 0px;
}
Looking in Element browser in Google Chrome, you have this class messed up
.onoffswitch-inner:before, .onoffswitch-inner:after {
You should not be using "width: x%". You should change the % to some unit such as px.
Related
How would I go about adding a sticky footer to the bottom of my page that isn't fixed. I made the mistake of adding the footer to my website last. The footer would be on top of an absolute positioned image. I tried using the absolute position, min-height solution but it didn't work. The footer isn't at the bottom of the total page (it will be at the bottom of the page of the initial starting position). Here is the HTML code and CSS code. I'm not sure where the issue/conflict and I have tried scanning and looking in the code but can't see it. HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Home </title>
<meta name="description" content="A music review website">
<link rel="stylesheet" href="css/main.css">
</head>
<body class="homepage">
<header>
<a href="index.php">
<img class="banner"
src="Pictures/second_banner_image_blue.jpg">
</a>
</header>
<nav>
<a class="homelink" id="activehome" href="index.php">Home</a>
<a class="reviewasonglink" href="Review_a_song.php">Review a
song</a>
<a class="reviewslink" href="Sort_by_rating.php">Reviews</a>
<a class="faqlink" href="faq.php">FAQ</a>
<a class="contactlink" href="contactpage.php">Contact us</a>
<form method="get" action="search.php">
<input type="text" name="q" class="searchbox"
placeholder="Search for a song, album or artist here...">
<input type="image" name="Search"
src="Pictures/magnifyingglass.png" class="searchbutton">
</form>
</nav>
<a href="Review_a_song.php"><img class="homepic1"
src="Pictures/concert_edit.jpg"></a>
<a href="Review_a_song.php"><p class="hometitle1">Review your
favourite music</p></a>
<a href="sort_by_rating.php"><img class="homepic2"
src="Pictures/songreviews_edit.jpg"></a>
<a href="sort_by_rating.php"><p class="hometitle2">Read
comprehensive reviews</p></a>
<a href="faq.php"><img class="homepic3"
src="Pictures/questions_edit.jpg"></a>
<p class="hometitle3">Questions?</p>
<footer>
<p>Copyright</p>
</footer>
</body>
</html>
CSS:
#font-face {
font-family: opensans; src: url('fonts/OpenSans.tff');
font-family: roboto; src: url('fonts/Roboto.tff');
font-family: robotobold; src: url('fonts/RobotoBold.tff');
font-family: headings; src: url('fonts/adamcg.otf');
}
html {
position: relative;
min-height: 100%;
}
body {
margin:0px;
padding: 0px;
height: 100%;
overflow-x: hidden;
background-attachment: fixed;
}
.homepage {
background-attachment: scroll;
}
.homepic1 {
height: 100%;
width: 100%;
position: absolute;
cursor: pointer;
}
.homepic2 {
height: 80%;
width: 100%;
position: absolute;
cursor: pointer;
transform: translateY(500px);
}
.homepic3 {
height: 100%;
width: 100%;
position: absolute;
cursor: pointer;
transform: translateY(972px);
}
header {
height: 86px;
}
a {
text-decoration-line: none;
}
.background {
display: block;
height: 100%;
}
a:visited {
color: currentColor;
}
h1 {
margin-left: 53px;
margin-top: 80px;
color: white;
font-family: opensans, sans-serif;
}
h2 {
margin-left: 46px;
text-decoration-line: underline;
color: white;
position: absolute;
transform: translateY(428px);
font-family: opensans, sans-serif;
}
h4 {
font-size: 30px;
font-family: opensans, sans-serif;
}
.review_content{
margin-left: 53px;
transform: translateY(50px);
color: white;
font-family: opensans, sans-serif;
}
nav {
width: 100%;
height: 40px;
background-color:white;
border: 0.5px solid black;
z-index: 1;
position: fixed;
}
nav a{
width:11.4%;
float: left;
text-align: center;
height: 30px;
padding-top: 10px;
color: black;
}
.homelink {
margin-left: 0px;
}
.hometitle1 {
color: black;
margin-top: 90px;
font-size: 65px;
position: absolute;
font-family: headings, sans-serif;
margin-left: 200px;
font-weight: 600;
text-shadow: 2px 2px 6px #565656;
cursor: pointer;
}
.hometitle2 {
color: black;
margin-top: 0px;
font-size: 65px;
position: absolute;
font-family: headings, sans-serif;
color: #16308d;
margin-left: 190px;
font-weight: 600;
text-shadow: 3px 3px 6px #0f2163;
transform: translateY(600px);
cursor: pointer;
}
.hometitle3 {
color: black;
margin-top: 0px;
font-size: 65px;
position: absolute;
font-family: headings, sans-serif;
color: #510000;
margin-left: 440px;
font-weight: 600;
text-shadow: 2px 2px 6px #450000;
transform: translateY(1070px);
cursor: pointer;
}
.reviewasonglink, .reviewslink, .contactlink, .faqlink, .homelink {
transition: 0.4s;
font-size: 16px;
text-decoration: none;
font-family: opensans, sans-serif;
}
.reviewasonglink:hover, .reviewslink:hover, .contactlink:hover,
.faqlink:hover, .homelink:hover {
background-color: #404040;
color:#e6e6e6;
}
#activesortbyrating, #activereviewasong, #activecontact, #activefaq,
#activehome {
background-color: #5e5e5e;
color:#e6e6e6;
}
#activesortbyrating:hover, #activereviewasong:hover, #activecontact:hover,
#activefaq:hover, #activehome:hover {
background-color: #404040;
color:#e6e6e6;
}
.banner {
z-index: 1;
position: fixed;
}
.searchbox {
float: right;
width: 230px;
margin-right: 80px;
padding: 5px;
height: 29px;
}
input::placeholder {
color: black;
font-size: 12.8px;
font-family: opensans, sans-serif;
}
input[name="q"] {
font-family: opensans, sans-serif;
border: none;
padding-bottom: 0px;
border-bottom: 0.8px solid black;
}
textarea:focus, input:focus{
outline: none;
}
.formentries {
margin-top: 80px;
margin-left: 53px;
color: white;
font-family: opensans, sans-serif;
}
.warning {
font-weight: bold;
}
.formentry {
font-size: 20px;
font-weight: bold;
font-family: opensans, sans-serif;
}
.searchbutton {
float: right;
width: 35px;
height: 35px;
transform: translateX(273px);
font-family: opensans, sans-serif;
}
input[type="radio"] {
position: absolute;
font-family: opensans, sans-serif;
}
textarea {
border: 1px solid black;
border-radius: 5px;
background-color: lightgray;
font-family: opensans, sans-serif;
}
select {
background-color: lightgray;
}
.formbox {
font-size: 20px;
font-family: opensans, sans-serif;
border: 1px solid black;
background-color: lightgray;
border-radius: 5px;
font-family: opensans, sans-serif;
}
.contactform {
padding-left: 53px;
margin-top: 25px;
font-size: 19px;
font-weight: 600;
color: white;
font-family: opensans, sans-serif;
}
.contactinfo {
padding-left: 53px;
margin-top: 70px;
color: white;
font-family: roboto, sans-serif;
}
.contactentry {
font-size: 18px;
font-family: opensans, sans-serif;
border: 1px solid black;
background-color: lightgray;
border-radius: 5px;
font-family: opensans, sans-serif;
}
.contactmessage {
font-size:15px;
font-family: opensans, sans-serif;
}
.searchtitle, .searchartist, .searchalbum {
color: white;
transform: translateX(53px);
font-family: opensans, sans-serif;
}
.searchtitle {
font-weight: bolder;
font-size: 18px;
text-decoration-line: none;
padding-top: 20px;
}
.FAQ {
margin-left: 53px;
margin-top: 80px;
margin-right: 30px;
color: white;
font-family: opensans, sans-serif;
}
.genreoptions {
max-width: 960px;
margin-left: 45px;
margin-top: 70px;
position: absolute;
border-spacing: 1;
}
.ratingoptions {
max-width: 960px;
transform: translateX(45px);
margin-top: 277px;
position: absolute;
border-spacing: 1;
}
.reviews th {
font-weight: 400;
background: #024457;
color:white;
}
.reviews {
max-width: 960px;
margin-left: 44px;
margin-top: 520px;
position: absolute;
margin-bottom: 10px;
}
.genreoptions thead th {
font-weight: 400;
background: #8a97a0;
color: #FFF;
}
.ratingoptions thead th {
font-weight: 400;
background: #8a97a0;
color: #FFF;
}
.ratingoptions tr {
background: #f4f7f8;
border-bottom: 1px solid #FFF;
margin-bottom: 5px;
}
.genreoptions tr {
background: #f4f7f8;
border-bottom: 1px solid #FFF;
margin-bottom: 5px;
}
.reviews tr {
background:white;
border-bottom: 1px solid #FFF;
margin-bottom: 5px;
}
.ratingoptions tr:nth-child(even) {
background: #e8eeef;
}
.genreoptions tr:nth-child(even) {
background: #e8eeef;
}
.reviews tr:nth-child(even) {
background:#e0ebfc;
}
th, td, tr {
padding: 8px;
font-weight: 300;
font-family: opensans, sans-serif;
}
.circle {
width: 17px;
height: 17px;
float: right;
padding-left: 25px;
}
input[type=radio]{
visibility: hidden;
position: absolute;
}
label > input + img{
cursor:pointer;
filter: brightness(0%);
transition: all 0.5s ease;
}
label > input:checked + img {
filter: brightness(100%);
}
label {
cursor: pointer;
display: block;
font-family: opensans, sans-serif;
}
.genreoptions, .ratingoptions td {
width: 33%;
}
.reviews tbody tr:hover td {
background-color:#d4d5d6;
}
.genreoptions tbody td:hover {
background-color: lightgray;
}
.ratingoptions tbody td:hover {
background-color: lightgray;
}
.reviews th, td {
cursor: pointer;
text-align: left;
}
.sortinfo {
position: absolute;
color: white;
transform: translate(45px, 468px);
font-family: opensans, sans-serif;
}
.filterbutton {
position: absolute;
transform: translate(45px, 405px);
width: 180px;
height: 30px;
border-radius: 20px;
background-color:white;
border: 0.5px solid midnightblue;
cursor: pointer;
font-family: opensans, sans-serif;
}
.body {
margin-top: 5px;
margin-left: 8px;
font-family: opensans, sans-serif;
}
.noreviewsinfo {
position: absolute;
transform: translate(45px, 420px);
color: white;
font-size: 30px;
font-family: opensans, sans-serif;
}
.submitbutton {
height: 30px;
width: 80px;
font-size: 16px;
margin-top: 8px;
margin-bottom: 8px;
background-color:steelblue;
color: black;
border: 0.5px solid black;
border-radius: 5px;
cursor: pointer;
box-shadow: inset 0 0 0 1px #27496d;
font-family: opensans, sans-serif;
}
.submitbutton:hover {
filter: brightness(70%);
font-family: opensans, sans-serif;
}
.nosearchresults {
color: white;
margin-left: 53px;
margin-top: 5px;
font-size: 17px;
font-family: opensans, sans-serif;
}
footer {
height: 30px;
width: 100%;
background-color: gray;
border: 1px solid black;
}
When you hover over the image, you will see that it will be replaced by the text block.
When you shrink the browser, you will see that the font size remains the same, although I specified it in EMs which should have made the font responsive.
I need the layout of the hover element remain the same in mobile view, i.e. I need to avoid the scrollbar that appears if you shrink the size of the browser. Any ideas how to achieve this?
/*Programs*/
ul.img-list {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
ul.img-list li {
display: inline-block;
width: 100%;
height: 100%;
margin: 0;
position: relative;
}
div.text-content {
background: rgba(26,33,43,0.9);
color: white;
cursor: pointer;
left: 0;
position: absolute;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
opacity: 0;
font-size: 1.250em;
font-family: Roboto;
line-height: 1em;
font-weight: 300;
text-align: center;
overflow-y: auto;
box-sizing: border-box;
padding-right: 25px;
padding-left: 25px;
padding-top: 25px;
padding-bottom: 25px;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
text-align: center;
vertical-align: middle;
}
ul.img-list li:hover div.text-content {
opacity: 1;
}
/* Events page */
/*Event link button*/
.btn {
background-color: transparent;
border-radius: 42px;
border: 2px solid #ffffff;
display: inline-block;
cursor: pointer;
font-family: Roboto;
line-height: 1.750em;
font-size: 1.500em;
padding: 5px 15px 5px 15px;
margin-right: 45px;
margin-left: 45px;
}
.btn:link {
color: #ffffff;
text-decoration: none;
}
.btn:visited {
color: #1b1c16;
text-decoration: none;
}
.btn:hover {
background-color: #ffffff;
color: #1b1c16 !important;
}
.btn:active {
position: relative;
top: 1px;
}
/*All events button*/
.evens_btn {
background: ;
}
.events_btn>span{
color: #f9c70f;
font-family: Roboto;
color: #ffffff;
font-size: 1.5em !important;
background: ;
text-decoration: none !important;
padding: 10px 0px 10px 0px;
}
.events_btn>i{
color: #ffffff;
margin-right: 15px;
font-size: 3.125em;
}
.events_btn:link>i {
color: #f9c70f;
}
.events_btn:visited>i {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>i {
color: #f9c70f;
}
.events_btn:active>i {
color: #f9c70f;
}
.events_btn:link>span {
color: #f9c70f;
}
.events_btn:visited>span {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>span {
color: #f9c70f ;
}
.events_btn:active>span {
color: #f9c70f;
}
<ul class="img-list">
<li><img style="width: 100%; height: 100%;" src="http://www.sflsupport.org/wp-content/uploads/2016/06/Programs-11.jpg" />
<div class="text-content">
<div>
<h5 style="color: white; font-size: 2.375em; font-family: Montserrat; font-weight: 600; line-height: 1em; letter-spacing: 0.125em;">WEBINAR<br/>ARCHIVE</h5>
<hr style="border-top: 0.125em solid #ffffff; width: auto; margin: 0.625em 1.875em;"/>Throughout the years SFL has ammased the library of recorded webinars from some of the leading libertarian voices about numerous topics in philosophy, politics, and economics. How can the government fix the higher education bubble? What is Ayn Rand's theory of natural rights? Tune in to our videos for answers to these questions and many more.
<br>
<a class="btn" style="color: white; text-align: center; margin-top: 0.625em; padding-top: 0.313em; padding-bottom: 0.313em; padding-left: 1.875em; padding-right: 1.875em; text-decoration: none; font-size: 1.500em; font-weight: 600; border: 3px solid white; letter-spacing: 0.125em;" href="http://www.google.com/" target="_blank">READ MORE</a>
</div>
</div>
</li>
</ul>
You can simply set the font size in vw instead of em
/*Programs*/
ul.img-list {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
ul.img-list li {
display: inline-block;
width: 100%;
height: 100%;
margin: 0;
position: relative;
}
div.text-content {
background: rgba(26,33,43,0.9);
color: white;
cursor: pointer;
left: 0;
position: absolute;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
opacity: 0;
font-size: 3vw;
font-family: Roboto;
line-height: 1em;
font-weight: 300;
text-align: center;
overflow-y: auto;
box-sizing: border-box;
padding-right: 25px;
padding-left: 25px;
padding-top: 25px;
padding-bottom: 25px;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
text-align: center;
vertical-align: middle;
}
ul.img-list li:hover div.text-content {
opacity: 1;
}
/* Events page */
/*Event link button*/
.btn {
background-color: transparent;
border-radius: 42px;
border: 2px solid #ffffff;
display: inline-block;
cursor: pointer;
font-family: Roboto;
line-height: 1.750em;
font-size: 1.500em;
padding: 5px 15px 5px 15px;
margin-right: 45px;
margin-left: 45px;
}
.btn:link {
color: #ffffff;
text-decoration: none;
}
.btn:visited {
color: #1b1c16;
text-decoration: none;
}
.btn:hover {
background-color: #ffffff;
color: #1b1c16 !important;
}
.btn:active {
position: relative;
top: 1px;
}
/*All events button*/
.evens_btn {
background: ;
}
.events_btn>span{
color: #f9c70f;
font-family: Roboto;
color: #ffffff;
font-size: 1.5em !important;
background: ;
text-decoration: none !important;
padding: 10px 0px 10px 0px;
}
.events_btn>i{
color: #ffffff;
margin-right: 15px;
font-size: 3.125em;
}
.events_btn:link>i {
color: #f9c70f;
}
.events_btn:visited>i {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>i {
color: #f9c70f;
}
.events_btn:active>i {
color: #f9c70f;
}
.events_btn:link>span {
color: #f9c70f;
}
.events_btn:visited>span {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>span {
color: #f9c70f ;
}
.events_btn:active>span {
color: #f9c70f;
}
<ul class="img-list">
<li><img style="width: 100%; height: 100%;" src="http://www.sflsupport.org/wp-content/uploads/2016/06/Programs-11.jpg" />
<div class="text-content">
<div>
<h5 style="color: white; font-size: 2.375em; font-family: Montserrat; font-weight: 600; line-height: 1em; letter-spacing: 0.125em;">WEBINAR<br/>ARCHIVE</h5>
<hr style="border-top: 0.125em solid #ffffff; width: auto; margin: 0.625em 1.875em;"/>Throughout the years SFL has ammased the library of recorded webinars from some of the leading libertarian voices about numerous topics in philosophy, politics, and economics. How can the government fix the higher education bubble? What is Ayn Rand's theory of natural rights? Tune in to our videos for answers to these questions and many more.
<br>
<a class="btn" style="color: white; text-align: center; margin-top: 0.625em; padding-top: 0.313em; padding-bottom: 0.313em; padding-left: 1.875em; padding-right: 1.875em; text-decoration: none; font-size: 1.500em; font-weight: 600; border: 3px solid white; letter-spacing: 0.125em;" href="http://www.google.com/" target="_blank">READ MORE</a>
</div>
</div>
</li>
</ul>
When you hover over the image, you will see that it will be replaced by the semi-transparent background in my code.
The transparent background is supposed to cover all the picture, however, it only covers the area taken by the text.
How do I make sure that it covers the whole picture, regardless of the text within the box?
/*Programs*/
ul.img-list {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
ul.img-list li {
display: inline-block;
width: 100%;
height: 100%;
margin: 0;
position: relative;
}
div.text-content {
background: rgba(26,33,43,0.9);
color: white;
cursor: pointer;
display: table;
left: 0;
position: absolute;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
font-size: 20px;
font-family: Roboto;
line-height: 24px;
font-weight: 200;
text-align: center;
overflow-y: auto;
padding-right: 25px;
padding-left: 25px;
padding-top: 25px;
padding-bottom: 25px;
box-sizing: border-box;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
overflow-y: auto;
}
div.text-content div {
display: block;
text-align: center;
vertical-align: middle;
}
ul.img-list li:hover div.text-content {
opacity: 1;
}
/* Events page */
/*Event link button*/
.btn {
background-color: transparent;
border-radius: 42px;
border: 2px solid #ffffff;
display: inline-block;
cursor: pointer;
font-family: Roboto;
line-height: 28px;
font-size: 24px;
padding: 5px 15px 5px 15px;
margin-right: 45px;
margin-left: 45px;
}
.btn:link {
color: #ffffff;
text-decoration: none;
}
.btn:visited {
color: #1b1c16;
text-decoration: none;
}
.btn:hover {
background-color: #ffffff;
color: #1b1c16 !important;
}
.btn:active {
position: relative;
top: 1px;
}
/*All events button*/
.evens_btn {
background: ;
}
.events_btn>span{
color: #f9c70f;
font-family: Roboto;
color: #ffffff;
font-size: 24px !important;
background: ;
text-decoration: none !important;
padding: 10px 0px 10px 0px;
}
.events_btn>i{
color: #ffffff;
margin-right: 15px;
font-size: 50px;
}
.events_btn:link>i {
color: #f9c70f;
}
.events_btn:visited>i {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>i {
color: #f9c70f;
}
.events_btn:active>i {
color: #f9c70f;
}
.events_btn:link>span {
color: #f9c70f;
}
.events_btn:visited>span {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>span {
color: #f9c70f ;
}
.events_btn:active>span {
color: #f9c70f;
}
<ul class="img-list">
<li><img style="width: 100%; height: 100%;" src="http://www.sflsupport.org/wp-content/uploads/2016/06/Programs-11.jpg" />
<div class="text-content">
<div>
<h5 style="color: white; font-size: 38px; font-family: Montserrat; font-weight: 600; line-height: 42px; letter-spacing: 2px;">WEBINAR<br/>ARCHIVE</h5>
<hr style="border-top: 2px solid #ffffff; width: auto; margin: 10px 30px;"/>Throughout the years SFL has ammased the library of recorded webinars from some of the leading libertarian voices about numerous topics in philosophy, politics, and economics. How can the government fix the higher education bubble? What is Ayn Rand's theory of natural rights? Tune in to our videos for answers to these questions and many more.
<br>
<a class="btn" style="color: white; text-align: center; margin-top: 10px; padding-top: 5px; padding-bottom: 5px; padding-left: 30px; padding-right: 30px; text-decoration: none; font-size: 24px; font-weight: 600; border: 3px solid white; letter-spacing: 2px;" href="http://www.google.com/" target="_blank">READ MORE</a>
</div>
</div>
</li>
</ul>
Remove display:table; from .text-content. Also add bottom:0; to it.
Remove display: table;, and for aligning the content vertically center use CSS Flexbox's align-content property.
Have a look at the snippet below:
/*Programs*/
ul.img-list {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
ul.img-list li {
display: inline-block;
width: 100%;
height: 100%;
margin: 0;
position: relative;
}
div.text-content {
background: rgba(26,33,43,0.9);
color: white;
cursor: pointer;
display: flex;
align-items: center;
left: 0;
position: absolute;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
font-size: 20px;
font-family: Roboto;
line-height: 24px;
font-weight: 200;
text-align: center;
overflow-y: auto;
padding-right: 25px;
padding-left: 25px;
padding-top: 25px;
padding-bottom: 25px;
box-sizing: border-box;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
overflow-y: auto;
}
div.text-content div {
display: block;
text-align: center;
vertical-align: middle;
}
ul.img-list li:hover div.text-content {
opacity: 1;
}
/* Events page */
/*Event link button*/
.btn {
background-color: transparent;
border-radius: 42px;
border: 2px solid #ffffff;
display: inline-block;
cursor: pointer;
font-family: Roboto;
line-height: 28px;
font-size: 24px;
padding: 5px 15px 5px 15px;
margin-right: 45px;
margin-left: 45px;
}
.btn:link {
color: #ffffff;
text-decoration: none;
}
.btn:visited {
color: #1b1c16;
text-decoration: none;
}
.btn:hover {
background-color: #ffffff;
color: #1b1c16 !important;
}
.btn:active {
position: relative;
top: 1px;
}
/*All events button*/
.evens_btn {
background: ;
}
.events_btn>span{
color: #f9c70f;
font-family: Roboto;
color: #ffffff;
font-size: 24px !important;
background: ;
text-decoration: none !important;
padding: 10px 0px 10px 0px;
}
.events_btn>i{
color: #ffffff;
margin-right: 15px;
font-size: 50px;
}
.events_btn:link>i {
color: #f9c70f;
}
.events_btn:visited>i {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>i {
color: #f9c70f;
}
.events_btn:active>i {
color: #f9c70f;
}
.events_btn:link>span {
color: #f9c70f;
}
.events_btn:visited>span {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>span {
color: #f9c70f ;
}
.events_btn:active>span {
color: #f9c70f;
}
<ul class="img-list"><li><img style="width: 100%; height: 100%;" src="http://www.sflsupport.org/wp-content/uploads/2016/06/Programs-11.jpg" /><div class="text-content"><div><h5 style="color: white; font-size: 38px; font-family: Montserrat; font-weight: 600; line-height: 42px; letter-spacing: 2px;">WEBINAR<br/>ARCHIVE</h5><hr style="border-top: 2px solid #ffffff; width: auto; margin: 10px 30px;"/>Throughout the years SFL has ammased the library of recorded webinars from some of the leading libertarian voices about numerous topics in philosophy, politics, and economics. How can the government fix the higher education bubble? What is Ayn Rand's theory of natural rights? Tune in to our videos for answers to these questions and many more.<br><a class="btn" style="color: white; text-align: center; margin-top: 10px; padding-top: 5px; padding-bottom: 5px; padding-left: 30px; padding-right: 30px; text-decoration: none; font-size: 24px; font-weight: 600; border: 3px solid white; letter-spacing: 2px;" href="http://www.google.com/" target="_blank">READ MORE</a></div></div></li></ul>
Hope this helps!
/*Programs*/
ul.img-list {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
ul.img-list li {
display: inline-block;
width: 100%;
height: 100%;
margin: 0;
position: relative;
}
div.text-content {
background: rgba(26,33,43,0.9);
color: white;
cursor: pointer;
left: 0;
position: absolute;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
font-size: 20px;
font-family: Roboto;
line-height: 24px;
font-weight: 200;
text-align: center;
overflow-y: auto;
padding-right: 25px;
padding-left: 25px;
padding-top: 25px;
padding-bottom: 25px;
box-sizing: border-box;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
transition: opacity 500ms;
overflow-y: auto;
}
div.text-content div {
display: table-cell;
text-align: center;
vertical-align: middle;
width: 100%;
height: 100%;
}
ul.img-list li:hover div.text-content {
opacity: 1;
}
/* Events page */
/*Event link button*/
.btn {
background-color: transparent;
border-radius: 42px;
border: 2px solid #ffffff;
display: inline-block;
cursor: pointer;
font-family: Roboto;
line-height: 28px;
font-size: 24px;
padding: 5px 15px 5px 15px;
margin-right: 45px;
margin-left: 45px;
}
.btn:link {
color: #ffffff;
text-decoration: none;
}
.btn:visited {
color: #1b1c16;
text-decoration: none;
}
.btn:hover {
background-color: #ffffff;
color: #1b1c16 !important;
}
.btn:active {
position: relative;
top: 1px;
}
/*All events button*/
.evens_btn {
background: ;
}
.events_btn>span{
color: #f9c70f;
font-family: Roboto;
color: #ffffff;
font-size: 24px !important;
background: ;
text-decoration: none !important;
padding: 10px 0px 10px 0px;
}
.events_btn>i{
color: #ffffff;
margin-right: 15px;
font-size: 50px;
}
.events_btn:link>i {
color: #f9c70f;
}
.events_btn:visited>i {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>i {
color: #f9c70f;
}
.events_btn:active>i {
color: #f9c70f;
}
.events_btn:link>span {
color: #f9c70f;
}
.events_btn:visited>span {
color: #ffffff;
text-decoration: none;
}
.events_btn:hover>span {
color: #f9c70f ;
}
.events_btn:active>span {
color: #f9c70f;
}
<ul class="img-list"><li><img style="width: 100%; height: 100%;" src="http://www.sflsupport.org/wp-content/uploads/2016/06/Programs-11.jpg" /><div class="text-content"><div><h5 style="color: white; font-size: 38px; font-family: Montserrat; font-weight: 600; line-height: 42px; letter-spacing: 2px;">WEBINAR<br/>ARCHIVE</h5><hr style="border-top: 2px solid #ffffff; width: auto; margin: 10px 30px;"/>Throughout the years SFL has ammased the library of recorded webinars from some of the leading libertarian voices about numerous topics in philosophy, politics, and economics. How can the government fix the higher education bubble? What is Ayn Rand's theory of natural rights? Tune in to our videos for answers to these questions and many more.<br><a class="btn" style="color: white; text-align: center; margin-top: 10px; padding-top: 5px; padding-bottom: 5px; padding-left: 30px; padding-right: 30px; text-decoration: none; font-size: 24px; font-weight: 600; border: 3px solid white; letter-spacing: 2px;" href="http://www.google.com/" target="_blank">READ MORE</a></div></div></li></ul>
Just add this Css:
.text-content div{
height:1326px;
}
I am making a microsite via Dreamweaver using the fluid layout. In it, I had my header and banner inside a table under a div like so:
<div id="divHeader">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
<td style="width: 30px;"></td>
<td style="vertical-align: middle; font-size: 1.3rem; font-weight: bold;">
<p><span>Move Toward </span> <span class="hdr">Zero Unplanned Downtime</span></p>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<img src="images/Mining_site_1192x181-12.png" alt=""/>
</td>
</tr>
</tbody>
</table>
</div>
In most browsers, this works well (including mobile browsers):
Unfortunately, in Firefox, it's shown this way:
When I used the built-in Inspect Elemet, this is what I see in Firefox:
For some reason, the table is displayed outside the DIV element. The table doesn't have a CSS class associated with it, and as for the DID, this is the CSS for its class divHeader:
#divHeader {
font-family: Arial;
background-color: #F89329;
text-transform: uppercase;
font-size: 1rem;
color: #fff;
line-height: 1rem;
border: none;
}
Is there an issue with tables within div in Firefox? If so, what's a good workaround?
Here is my CSS code:
#charset "utf-8";
/* Simple fluid media
Note: Fluid media requires that you remove the media's height and width attributes from the HTML
http://www.alistapart.com/articles/fluid-images/
*/
img, object, embed, video {
max-width: 100%;
}
a {
text-decoration: none;
}
a: hover {
color: #F59D51;
text-decoration: none;
}
/* IE 6 does not support max-width so default to width 100% */
.ie6 img {
width:100%;
}
/*
Dreamweaver Fluid Grid Properties
----------------------------------
dw-num-cols-mobile: 4;
dw-num-cols-tablet: 8;
dw-num-cols-desktop: 12;
dw-gutter-percentage: 25;
Inspiration from "Responsive Web Design" by Ethan Marcotte
http://www.alistapart.com/articles/responsive-web-design
and Golden Grid System by Joni Korpi
http://goldengridsystem.com/
*/
.fluid {
clear: both;
margin-left: 0;
width: 100%;
float: left;
display: block;
}
.fluidList {
list-style:none;
list-style-image:none;
margin:0;
padding:0;
}
/* Mobile Layout: 480px and below. */
.gridContainer {
margin-left: auto;
margin-right: auto;
width: 86.45%;
padding-left: 0.75%;
padding-right: 0.75%;
margin: auto;
clear: none;
float: none;
background-color: #fff;
}
.zeroMargin_mobile {
margin-left: 0;
}
.hide_mobile {
display: none;
}
#divEPMLogo {
background-color:#fff;
}
#divHeader {
font-family: Arial;
background-color: #F89329;
text-transform: uppercase;
font-size: 1rem;
color: #fff;
line-height: 1rem;
border: none;
}
#divHeader td.tdBanner {
background-image: url(../images/Mining_site_v2_Banner480.png);
background-position: bottom;
background-repeat: no-repeat;
background-size: contain;
height: 181px;
max-width: 480px;
margin: 0px;
}
#divSubheader {
font-family: Arial;
background-color: #fff;
text-transform: uppercase;
font-size: 1rem;
color: #4D4F44;
line-height: 1.3rem;
border: none;
}
div.divCnt {
width: 100%;
border: none;
}
#content header {
font-size: 1.1rem;
font-weight: bold;
color: #4D4F44;
font-family: Arial;
}
#content article {
font-size: 1rem;
color: #818183;
font-family: Arial;
}
#content hr {
width: 100%;
height: 3px;
color: #FFD022;
background-color: #FFD022;
border: none;
margin-top: 0px;
}
div.divBack {
width: 100%;
text-align: center;
}
div.divBack a {
color: #818183;
font-size: 0.9rem;
font-family: Arial;
text-decoration: none;
}
div.divBack a:hover {
color: #F89329;
text-decoration: none;
}
div.divRMBtn {
color: #fff;
background-color: #F89329;
text-align: center;
font-size: 0.9rem;
width: 6rem;
padding: 3px 0px;
font-family: Arial;
}
div.divRMBtn a {
color: #fff;
text-decoration: none;
}
div.divRMBtn a:hover {
color: #fff;
text-decoration: none;
}
div.divSecFt {
font-size: 0.8rem;
font-style: italic;
font-family: Arial;
padding: 10px 0px;
}
div.divSecFt a {
color: #4D4F44;
text-decoration: none;
}
div.divSecFt a:hover {
color: #F89329;
text-decoration: none;
}
div.container1 {
display:table-cell;
vertical-align: middle;
border: 1px solid black;
/*padding: 0px 0px 0px 30px;*/
position: relative;
left: 30px;
}
div.divForm {
font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 1rem;
text-align: left; width:50%;
height: 26rem;
min-width: 320px;
margin: 0 auto;
color:#4B4B4B;
border: none;
}
span.hdr {
color: #4D4F44;
text-wrap: none;
}
span.hdr2 {
color: #F59D51;
text-transform: uppercase;
font-size: 1.1rem;
font-weight: bold;
}
td.td-ico {
width: 73px;
max-width: 73px;
min-width: 73px;
text-align: center;
vertical-align: top;
padding-right: 5px;
}
.ulNltr{
color: #4D4F44;
font-family: Arial;
font-size: 0.9rem;
line-height: 1rem;
margin-left: 0px;
padding-left: 15px;
}
.ulNltr li {
padding-bottom: 10px;
list-style-image:url(../images/icons/bullet.png)
}
.ulNltr li.q1 {
list-style-image:url(../images/icons/question_icon.jpg)
}
.ulNltr li.c1 {
list-style-image:url(../images/icons/contact_icon.jpg)
}
.ulNltr a {
color: #4D4F44;
text-decoration: none;
}
.ulNltr a:hover {
color: #F89329;
text-decoration: none;
}
/* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */
#media only screen and (min-width: 481px) {
.gridContainer {
margin-left: auto;
margin-right: auto;
width: 90.675%; /*width: 480px;*/
padding-left: 0.75%;
padding-right: 0.75%;
margin: auto;
clear: none;
float: none;
background-color: #fff;
}
.zeroMargin_tablet {
margin-left: 0;
}
.hide_tablet {
display: none;
}
#divEPMLogo {
background-color:#fff;
}
#divHeader {
font-family: Arial;
background-color: #F89329;
text-transform: uppercase;
font-size: 1rem;
color: #fff;
line-height: 1rem;
border: none;
}
#divHeader td.tdBanner {
background-image: url(../images/Mining_site_v2_Banner768.png);
background-position: bottom;
background-repeat: no-repeat;
background-size: contain;
height: 181px;
max-width: 480px;
margin: 0px;
}
#divSubheader {
font-family: Arial;
background-color: #fff;
text-transform: uppercase;
font-size: 1rem;
color: #4D4F44;
line-height: 1.3rem;
border: none;
}
div.divCnt {
width: 100%;
border: none;
}
#content header {
font-size: 1.1rem;
font-weight: bold;
color: #4D4F44;
font-family: Arial;
}
#content article {
font-size: 1rem;
color: #818183;
font-family: Arial;
}
#content hr {
width: 100%;
height: 3px;
color: #FFD022;
background-color: #FFD022;
border: none;
margin-top: 0px;
}
div.divBack {
width: 100%;
text-align: center;
}
div.divBack a {
color: #818183;
font-size: 0.9rem;
font-family: Arial;
text-decoration: none;
}
div.divBack a:hover {
color: #F89329;
text-decoration: none;
}
div.divRMBtn {
color: #fff;
background-color: #F89329;
text-align: center;
font-size: 0.9rem;
width: 6rem;
padding: 3px 0px;
font-family: Arial;
}
div.divRMBtn a {
color: #fff;
text-decoration: none;
}
div.divRMBtn a:hover {
color: #fff;
text-decoration: none;
}
div.divSecFt {
font-size: 0.8rem;
font-style: italic;
font-family: Arial;
padding: 10px 0px;
}
div.divSecFt a {
color: #4D4F44;
text-decoration: none;
}
div.divSecFt a:hover {
color: #F89329;
text-decoration: none;
}
div.container1 {
display:table-cell;
vertical-align: middle;
border: 1px solid black;
/*padding: 0px 0px 0px 30px;*/
position: relative;
left: 30px;
}
div.divForm {
font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 1rem;
text-align: left; width:50%;
height: 26rem;
min-width: 320px;
margin: 0 auto;
color:#4B4B4B;
border: none;
}
span.hdr {
color: #4D4F44;
text-wrap: none;
}
span.hdr2 {
color: #F59D51;
text-transform: uppercase;
font-size: 1.1rem;
font-weight: bold;
}
td.td-ico {
width: 73px;
max-width: 73px;
min-width: 73px;
text-align: center;
vertical-align: top;
padding-right: 5px;
}
.ulNltr{
color: #4D4F44;
font-family: Arial;
font-size: 0.8rem;
line-height: 1rem;
}
.ulNltr li {
padding-bottom: 10px;
list-style-image:url(../images/icons/bullet.png)
}
.ulNltr a {
color: #4D4F44;
text-decoration: none;
}
.ulNltr a:hover {
color: #F89329;
text-decoration: none;
}
}
/* Desktop Layout: 769px to a max of 1079px. Inherits styles from: Mobile Layout and Tablet Layout. */
#media only screen and (min-width: 769px) {
.gridContainer {
width: 88.5%; /*width: 768px;*/
max-width: 768px;
padding-left: 0.75%;
padding-right: 0.75%;
margin: auto;
clear: none;
float: none;
margin-left: auto;
margin-right: auto;
background-color: #fff;
}
.zeroMargin_desktop {
margin-left: 0;
}
.hide_desktop {
display: none;
}
#divEPMLogo {
background-color:#fff;
}
#divHeader {
font-family: Arial;
background-color: #F89329;
text-transform: uppercase;
font-size: 1rem;
color: #fff;
line-height: 1rem;
border: none;
}
#divHeader td.tdBanner {
background-image: url(../images/Mining_site_v2_Banner768.png);
background-position: center;
background-repeat: no-repeat;
background-size: contain;
height: 181px;
max-width: 768px;
margin: 0px;
}
#divSubheader {
font-family: Arial;
background-color: #fff;
text-transform: uppercase;
font-size: 1rem;
color: #4D4F44;
line-height: 1.3rem;
border: none;
}
div.divCnt {
width: 33%;
float: left;
border: none;
}
#content header {
font-size: 1.1rem;
font-weight: bold;
color: #4D4F44;
font-family: Arial;
}
#content article {
font-size: 1rem;
color: #818183;
font-family: Arial;
}
#content hr {
width: 100%;
height: 3px;
color: #FFD022;
background-color: #FFD022;
border: none;
margin-top: 0px;
}
div.cntRw {
display: table-cell;
}
div.divBack {
width: 100%;
text-align: center;
}
div.divBack a {
color: #818183;
font-size: 0.9rem;
font-family: Arial;
text-decoration: none;
}
div.divBack a:hover {
color: #F89329;
text-decoration: none;
}
div.divRMBtn {
color: #fff;
background-color: #F89329;
text-align: center;
font-size: 0.9rem;
width: 6rem;
padding: 3px 0px;
font-family: Arial;
}
div.divRMBtn a {
color: #fff;
text-decoration: none;
}
div.divRMBtn a:hover {
color: #fff;
text-decoration: none;
}
div.divSecFt {
font-size: 0.8rem;
font-style: italic;
font-family: Arial;
padding: 10px 0px;
}
div.divSecFt a {
color: #4D4F44;
text-decoration: none;
}
div.divSecFt a:hover {
color: #F89329;
text-decoration: none;
}
div.container1 {
display:table-cell;
vertical-align: middle;
border: 1px solid black;
/*padding: 0px 0px 0px 30px;*/
position: relative;
left: 30px;
}
div.divForm {
font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 1rem;
text-align: left; width:50%;
height: 26rem;
min-width: 320px;
margin: 0 auto;
color:#4B4B4B;
border: none;
}
span.hdr {
color: #4D4F44;
text-wrap: none;
}
span.hdr2 {
color: #F59D51;
text-transform: uppercase;
font-size: 1.1rem;
font-weight: bold;
}
td.td-ico {
width: 73px;
max-width: 73px;
min-width: 73px;
text-align: center;
vertical-align: top;
padding-right: 5px;
}
.ulNltr{
color: #4D4F44;
font-family: Arial;
font-size: 0.8rem;
line-height: 1rem;
}
.ulNltr li {
padding-bottom: 10px;
list-style-image:url(../images/icons/bullet.png)
}
.ulNltr a {
color: #4D4F44;
text-decoration: none;
}
.ulNltr a:hover {
color: #F89329;
text-decoration: none;
}
}
/* Desktop Layout: 1080p and beyond. Inherits styles from: Mobile Layout and Tablet Layout. */
#media only screen and (min-width: 1079px) {
.gridContainer {
width: 88.5%; /*width: 1192px; */
max-width: 1192px;
padding-left: 0.75%;
padding-right: 0.75%;
margin: auto;
clear: none;
float: none;
margin-left: auto;
margin-right: auto;
background-color: #fff;
}
.zeroMargin_desktop {
margin-left: 0;
}
.hide_desktop {
display: none;
}
#divEPMLogo {
background-color:#fff;
}
#divHeader {
font-family: Arial;
background-color: #F89329;
text-transform: uppercase;
font-size: 1rem;
color: #fff;
line-height: 1rem;
border: none;
clear: right;
}
#divHeader td.tdBanner {
background-image: url(../images/Mining_site_1192x181-12.png);
background-position: center;
background-repeat: no-repeat;
background-size: contain;
height: 181px;
max-width: 1191px;
margin: 0px;
}
#divSubheader {
font-family: Arial;
background-color: #fff;
text-transform: uppercase;
font-size: 1rem;
color: #4D4F44;
line-height: 1.3rem;
border: none;
}
div.divCnt {
width: 33%;
float: left;
border: none;
}
#content header {
font-size: 1.1rem;
font-weight: bold;
color: #4D4F44;
font-family: Arial;
}
#content article {
font-size: 1rem;
color: #818183;
font-family: Arial;
}
#content hr {
width: 100%;
height: 3px;
color: #FFD022;
background-color: #FFD022;
border: none;
margin-top: 0px;
}
div.cntRw {
display: table-cell;
}
div.divBack {
width: 100%;
text-align: center;
margin: 0px;
}
div.divBack a {
color: #818183;
font-size: 0.9rem;
font-family: Arial;
text-decoration: none;
}
div.divBack a:hover {
color: #F89329;
text-decoration: none;
}
div.divRM {
color: #818183;
font-size: 0.9rem;
font-family: Arial;
}
div.divRMBtn {
color: #fff;
background-color: #F89329;
text-align: center;
font-size: 0.9rem;
width: 6rem;
padding: 3px 0px;
font-family: Arial;
}
div.divRMBtn a {
color: #fff;
text-decoration: none;
}
div.divRMBtn a:hover {
color: #fff;
text-decoration: none;
}
div.divSecFt {
font-size: 0.8rem;
font-style: italic;
font-family: Arial;
padding: 10px 0px;
}
div.divSecFt a {
color: #4D4F44;
text-decoration: none;
}
div.divSecFt a:hover {
color: #F89329;
text-decoration: none;
}
div.container1 {
display:table-cell;
vertical-align: middle;
border: 1px solid black;
/*padding: 0px 0px 0px 30px;*/
position: relative;
left: 30px;
}
div.divForm {
font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 1rem;
text-align: left; width:50%;
height: 26rem;
min-width: 320px;
margin: 0 auto;
color:#4B4B4B;
border: none;
}
span.hdr {
color: #4D4F44;
text-wrap: none;
}
span.hdr2 {
color: #F59D51;
text-transform: uppercase;
font-size: 1.1rem;
font-weight: bold;
}
td.td-ico {
width: 73px;
max-width: 73px;
min-width: 73px;
text-align: center;
vertical-align: top;
padding-right: 5px;
}
.ulNltr{
color: #4D4F44;
font-family: Arial;
font-size: 0.8rem;
line-height: 1rem;
}
.ulNltr li {
padding-bottom: 10px;
list-style-image:url(../images/icons/bullet.png)
}
.ulNltr a {
color: #4D4F44;
text-decoration: none;
}
.ulNltr a:hover {
color: #F89329;
text-decoration: none;
}
}
It does seem that Firefox is having problems with the table within the div. I changed the HTML part to this:
<!-- Page header and banner -->
<div id="divHeader">
<div style="display: table-cell; vertical-align: middle;">
<p>Move Toward <span class="hdr">Zero Unplanned Downtime</span></p>
</div>
</div>
<div id="divHBanner">
<img src="images/Mining_site_1192x181-12.png" alt=""/>
</div>
<!-- End Page header and banner -->
It fixed the original error, but it opened up another. I will post a separate question for that instead.
I have tried in jsfiddle and in my web test page and everything is okay when I remove #charset"utf-8";
when I set it again, it went collided again
Hi there am having a problem with my navigation menu, it's using a link to Yanone Kaffeesatz via Google Fonts and using 26pt and small caps - it looks fine in IE/FF and Chrome but just checked Safari and Iphone and the font-size is considerably larger - so much so that the menu adds a second line
I don't think it's a problem with default font size on Safari as other fonts look identical to other browsers.
Here is the CSS, any help would be much appreciated
* {margin: 0; padding: 0;}
ul {list-style: none;}
a {color: black; text-decoration: none; padding-bottom: 3px;}
a:visited {color: black;}
body {
width: 100%;
font-size: 100%;
background-color: #bab89b;
background-image:url('http://xxx/assets/background.jpg');
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
}
container {
width: 900px;
margin: 0 auto;
}
#header {
width: 900px;
text-align: center;
margin: 0 auto;
}
#photo {
float: left;
margin-left: 80px;
margin-right: 80px;
margin-top: 30px;
}
#photo img {
padding: 10px;
background-color: #eee;
border: 2px solid #ccc;
rotation: 90deg;
-webkit-transform: rotate(-10deg) scale(0.9);
-moz-transform: rotate(-10deg) scale(0.9);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
}
#photo img:hover {
-webkit-transform: rotate(10deg) scale(1.1);
-moz-transform: rotate(10deg) scale(1.1);
}
#titles {float: left;}
#header h1 {
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 56pt;
font-weight: 100;
margin-top: 30px;
}
#header h2 {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-style: italic;
font-weight: 300;
font-size: 20pt;
}
/* NAVIGATION */
#navWrap {
width: 900px;
height: 3em;
margin: 0 auto;
margin-top: 30px;
padding-top: 1em;
padding-bottom: 1em;
border-top: 1px solid black;
border-bottom: 1px solid black;
text-align: center;
}
#nav {
width: 900px;
}
#nav li {
display: inline;
line-height: 3em;
padding: 0 20px;
}
#nav li a {
font-family: Yanone Kaffeesatz, sans-serif;
color: black;
font-variant: small-caps;
font-size: 26pt;
margin-right: 40px;
text-decoration: none;
}
#nav li a:hover {border-bottom: 4px solid black;}
#nav li a.current:hover {border-bottom: none;}
/* CONTENT */
#content {
width: 900px;
margin: 0 auto;
text-align: center;
}
#contentHeader {
width: 900px;
margin: 0 auto;
margin-top: 40px;
margin-bottom: 20px;
text-align: center;
}
#contentHeader h2 {
font-family: Helvetica Neue; Arial, sans-serif;
font-size: 24pt;
font-weight: 100;
}
/* SUBJECTS PAGE */
#box1, #box2, #box3 {
width: 900px;
margin: 0 auto;
margin-bottom: 50px;
font-family: Helvetica Neue, Arial, sans-serif;
font-weight: 100;
}
.clearer {
clear: both;
}
.leftContent {
float: left;
width: 480px;
height: 240px;
padding: 40px;
border: 1px solid #e7e7e7;
background-color: #e7e7e7;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin-bottom: 30px;
}
.leftContent h3 {
font-size: 22pt;
font-weight: 100;
margin-bottom: 20px;
}
.leftContent h4 {
font-size: 18pt;
font-weight: 100;
margin-bottom: 20px;
}
.leftContent p {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 11pt;
line-height: 1.5em;
font-weight: 300;
}
.rightContent {
float: right;
width: 200px;
height: 120px;
vertical-align: middle;
padding: 40px;
margin-top: 60px;
margin-bottom: 30px;
font-style: italic;
}
.rightContent h3 {
font-size: 16pt;
font-weight: 100;
margin-bottom: 15px;
}
.rightContent li {
font-size: 11pt;
font-weight: 100;
line-height: 1.5em;
}
/* FEEDBACK */
.bubbleText {
width: 550px;
margin: 30px auto 5px auto;
border: 1px solid #ccc;
background-color: #e7e7e7;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
padding: 20px 30px;
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 10pt;
font-weight: 300;
}
.bubbleDesc {
margin-bottom:
}
#showMoreLink, #showLessLink {
margin-top: 40px;
font-size: 24pt;
font-style: italic;
font-variant: small-caps;
cursor: pointer;
}
#showMoreLink:hover, #showLessLink:hover {
text-decoration: underline;
}
#moreText {
display: none;
}
/* BIO */
#leftBioBlock {
float: left;
width: 400px;
margin-right: 60px;
margin-left: 20px;
}
#rightBioBlock {
float: left;
width: 400px;
}
.bioTextBlock {
font-family: 'Yanone Kaffeesatz', sans-serif;
width: 350px;
height: 300px;
margin: 0 auto 50px auto;
padding:30px;
border: 1px solid #e7e7e7;
background-color: #e7e7e7;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
position: relative;
}
.bioTextBlockCenter {
font-family: 'Yanone Kaffeesatz', sans-serif;
width: 400px;
height: 300px;
margin: 0 auto;
padding:30px;
border: 1px solid #e7e7e7;
background-color: #e7e7e7;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.bioTextBlockCenter:hover
.bioTextBlock, .bioTextBlockCenter{
-moz-box-shadow: 5px 5px 3px #888;
-webkit-box-shadow: 5px 5px 3px #888;
box-shadow: 5px 5px 3px #888;
}
.bioTextHead {
font-size: 28pt;
margin-bottom: 20px;
}
.bioTextBlock p, bioTextBlock li, .bioList {
font-family: Helvetica Neue, Arial, Sans-serif;
font-weight: 300;
font-size: 11pt;
line-height: 1.4em;
}
.bioList li {
line-height: 2em;
}
#CVlink {
position: absolute;
left: 85px;
bottom: 30px;
text-align: center;
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 18pt;
font-weight: 100;
-webkit-transition: color 0.4s linear;
-moz-transition: color 0.4s linear;
}
#CVlink:hover {
color: #ce984e;
}
/* FORM */
form {
width: 900px;
margin: 0 auto;
padding: 40px;
}
legend {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 18pt;
padding-bottom: 15px;
font-weight: 100;
}
label {
font-family: 'Yanone Kaffeesatz', sans-serif;
font-size: 16pt;
display: block;
}
input, select {
width: 250px;
height: 1.5em;
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 12pt;
color: #575754;
margin-bottom: 15px;
}
fieldset#formCol1 {
width: 300px;
padding: 25px;
display: inline;
margin-right: 80px;
margin-left: 60px;
vertical-align:top;
}
fieldset#formCol2{
width: 300px;
padding: 25px;
padding-bottom: 37px;
display: inline;
vertical-align: top;
}
fieldset#formCol3 {
clear: both;
width: 740px;
margin: 30px auto 0 60px;
text-align: center;
padding: 25px;
}
select {
margin-bottom: 15px;
}
#sendButton {
width: 80px;
}
textarea {
width: 450px;
height: 150px;
padding: 5px;
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 11pt;
}
placeholder {
font-size: 11pt;
font-style: italic;
}
#denotes {
text-align: center;
margin-top: -20px;
margin-bottom: -20px;
font-weight: 100;
}
/* HIDDEN SPAM TRAP BOX */
input.random {display: none;}
/* FOOTER */
#footer {
width: 900px;
margin: 100px auto 0 auto;
text-align: center;
padding-top: 60px;
padding-bottom: 20px;
border-top: 1px dashed #666;
}
#footerCopy {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 10pt;
font-weight: 100;
text-align: center;
}
.siteLink {
text-align: center;
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 28pt;
font-weight: 100;
-webkit-transition: color 0.8s linear;
-moz-transition: color 0.8s linear;
}
.siteLink:hover {color: #ce984e; border-bottom: none;}
#profTutor {
text-align: center;
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 14pt;
font-weight: 100;
font-variant: small-caps;
margin-bottom: 20px;
}
/* IPHONE RULES */
#media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
div#rightContent1, div#rightContent2, div#rightContent3 {
display: block;
}
}
Use 26 px, not 26 pt. Points are intended for print, not screen display and will look different in each browser.
Add this in your body
display: 0.99;
So the whole css will be
* {margin: 0; padding: 0;}
ul {list-style: none;}
a {color: black; text-decoration: none; padding-bottom: 3px;}
a:visited {color: black;}
body {
width: 100%;
font-size: 100%;
background-color: #bab89b;
background-image:url('http://xxx/assets/background.jpg');
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
display: 0.99;
}
container {
width: 900px;
margin: 0 auto;
}
#header {
width: 900px;
text-align: center;
margin: 0 auto;
}
#photo {
float: left;
margin-left: 80px;
margin-right: 80px;
margin-top: 30px;
}
#photo img {
padding: 10px;
background-color: #eee;
border: 2px solid #ccc;
rotation: 90deg;
-webkit-transform: rotate(-10deg) scale(0.9);
-moz-transform: rotate(-10deg) scale(0.9);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
}
#photo img:hover {
-webkit-transform: rotate(10deg) scale(1.1);
-moz-transform: rotate(10deg) scale(1.1);
}
#titles {float: left;}
#header h1 {
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 56pt;
font-weight: 100;
margin-top: 30px;
}
#header h2 {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-style: italic;
font-weight: 300;
font-size: 20pt;
}
/* NAVIGATION */
#navWrap {
width: 900px;
height: 3em;
margin: 0 auto;
margin-top: 30px;
padding-top: 1em;
padding-bottom: 1em;
border-top: 1px solid black;
border-bottom: 1px solid black;
text-align: center;
}
#nav {
width: 900px;
}
#nav li {
display: inline;
line-height: 3em;
padding: 0 20px;
}
#nav li a {
font-family: Yanone Kaffeesatz, sans-serif;
color: black;
font-variant: small-caps;
font-size: 26pt;
margin-right: 40px;
text-decoration: none;
}
#nav li a:hover {border-bottom: 4px solid black;}
#nav li a.current:hover {border-bottom: none;}
/* CONTENT */
#content {
width: 900px;
margin: 0 auto;
text-align: center;
}
#contentHeader {
width: 900px;
margin: 0 auto;
margin-top: 40px;
margin-bottom: 20px;
text-align: center;
}
#contentHeader h2 {
font-family: Helvetica Neue; Arial, sans-serif;
font-size: 24pt;
font-weight: 100;
}
/* SUBJECTS PAGE */
#box1, #box2, #box3 {
width: 900px;
margin: 0 auto;
margin-bottom: 50px;
font-family: Helvetica Neue, Arial, sans-serif;
font-weight: 100;
}
.clearer {
clear: both;
}
.leftContent {
float: left;
width: 480px;
height: 240px;
padding: 40px;
border: 1px solid #e7e7e7;
background-color: #e7e7e7;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin-bottom: 30px;
}
.leftContent h3 {
font-size: 22pt;
font-weight: 100;
margin-bottom: 20px;
}
.leftContent h4 {
font-size: 18pt;
font-weight: 100;
margin-bottom: 20px;
}
.leftContent p {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 11pt;
line-height: 1.5em;
font-weight: 300;
}
.rightContent {
float: right;
width: 200px;
height: 120px;
vertical-align: middle;
padding: 40px;
margin-top: 60px;
margin-bottom: 30px;
font-style: italic;
}
.rightContent h3 {
font-size: 16pt;
font-weight: 100;
margin-bottom: 15px;
}
.rightContent li {
font-size: 11pt;
font-weight: 100;
line-height: 1.5em;
}
/* FEEDBACK */
.bubbleText {
width: 550px;
margin: 30px auto 5px auto;
border: 1px solid #ccc;
background-color: #e7e7e7;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
padding: 20px 30px;
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 10pt;
font-weight: 300;
}
.bubbleDesc {
margin-bottom:
}
#showMoreLink, #showLessLink {
margin-top: 40px;
font-size: 24pt;
font-style: italic;
font-variant: small-caps;
cursor: pointer;
}
#showMoreLink:hover, #showLessLink:hover {
text-decoration: underline;
}
#moreText {
display: none;
}
/* BIO */
#leftBioBlock {
float: left;
width: 400px;
margin-right: 60px;
margin-left: 20px;
}
#rightBioBlock {
float: left;
width: 400px;
}
.bioTextBlock {
font-family: 'Yanone Kaffeesatz', sans-serif;
width: 350px;
height: 300px;
margin: 0 auto 50px auto;
padding:30px;
border: 1px solid #e7e7e7;
background-color: #e7e7e7;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
position: relative;
}
.bioTextBlockCenter {
font-family: 'Yanone Kaffeesatz', sans-serif;
width: 400px;
height: 300px;
margin: 0 auto;
padding:30px;
border: 1px solid #e7e7e7;
background-color: #e7e7e7;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.bioTextBlockCenter:hover
.bioTextBlock, .bioTextBlockCenter{
-moz-box-shadow: 5px 5px 3px #888;
-webkit-box-shadow: 5px 5px 3px #888;
box-shadow: 5px 5px 3px #888;
}
.bioTextHead {
font-size: 28pt;
margin-bottom: 20px;
}
.bioTextBlock p, bioTextBlock li, .bioList {
font-family: Helvetica Neue, Arial, Sans-serif;
font-weight: 300;
font-size: 11pt;
line-height: 1.4em;
}
.bioList li {
line-height: 2em;
}
#CVlink {
position: absolute;
left: 85px;
bottom: 30px;
text-align: center;
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 18pt;
font-weight: 100;
-webkit-transition: color 0.4s linear;
-moz-transition: color 0.4s linear;
}
#CVlink:hover {
color: #ce984e;
}
/* FORM */
form {
width: 900px;
margin: 0 auto;
padding: 40px;
}
legend {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 18pt;
padding-bottom: 15px;
font-weight: 100;
}
label {
font-family: 'Yanone Kaffeesatz', sans-serif;
font-size: 16pt;
display: block;
}
input, select {
width: 250px;
height: 1.5em;
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 12pt;
color: #575754;
margin-bottom: 15px;
}
fieldset#formCol1 {
width: 300px;
padding: 25px;
display: inline;
margin-right: 80px;
margin-left: 60px;
vertical-align:top;
}
fieldset#formCol2{
width: 300px;
padding: 25px;
padding-bottom: 37px;
display: inline;
vertical-align: top;
}
fieldset#formCol3 {
clear: both;
width: 740px;
margin: 30px auto 0 60px;
text-align: center;
padding: 25px;
}
select {
margin-bottom: 15px;
}
#sendButton {
width: 80px;
}
textarea {
width: 450px;
height: 150px;
padding: 5px;
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 11pt;
}
placeholder {
font-size: 11pt;
font-style: italic;
}
#denotes {
text-align: center;
margin-top: -20px;
margin-bottom: -20px;
font-weight: 100;
}
/* HIDDEN SPAM TRAP BOX */
input.random {display: none;}
/* FOOTER */
#footer {
width: 900px;
margin: 100px auto 0 auto;
text-align: center;
padding-top: 60px;
padding-bottom: 20px;
border-top: 1px dashed #666;
}
#footerCopy {
font-family: HelveticaNeue-Light, Helvetica Neue, Arial, sans-serif;
font-size: 10pt;
font-weight: 100;
text-align: center;
}
.siteLink {
text-align: center;
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 28pt;
font-weight: 100;
-webkit-transition: color 0.8s linear;
-moz-transition: color 0.8s linear;
}
.siteLink:hover {color: #ce984e; border-bottom: none;}
#profTutor {
text-align: center;
font-family: Helvetica Neue, Arial, sans-serif;
font-size: 14pt;
font-weight: 100;
font-variant: small-caps;
margin-bottom: 20px;
}
/* IPHONE RULES */
#media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
div#rightContent1, div#rightContent2, div#rightContent3 {
display: block;
}
}