I'm having some trouble with my CSS code. I want to add a class to my header element so that I can differentiate in my stylesheet between the header for my homepage and the header for content pages. I started out with a header without a class, and everything was functioning properly. Suddenly, when I decided to add a class to my header element, the background image disappeared, and I can't figure out why.
This works:
header {
width: 100%;
height: 511px;
background: url('cakesresized.jpg') no-repeat;
margin: 10px 0px;
}
.homepgintro {
font-size: 0.9em;
position: absolute;
left: 65%;
height: 22em;
width: 22em;
background-color: rgba(181, 194, 202, 1);
padding: 7px;
color: #fff;
text-align: center;
}
.homepgintro img {
display: block;
width: 150px;
margin: 0 auto;
border-radius: 100px;
}
When the corresponding HTML is as follows:
<header class="homepg1"><h1>Shannon Loves Sweets</h1>
<div class="homepgintro">
<img src="profile.jpg">
<h2>Hi there!</h2>
<p>I'm Shannon! I'm a super busy full-time employee/part-time student who <i>loves</i> sweets and all things fried. Join me on my journey to cook at home more often, and to eat healthier while still working in some sweet treats!</p></div></header>
But THIS CSS will not work, and makes the background image disappear:
.homepg1 {
width: 100%;
height: 511px;
background: url('cakesresized.jpg') no-repeat;
margin: 10px 0px;
}
.homepgintro {
font-size: 0.9em;
position: absolute;
left: 65%;
height: 22em;
width: 22em;
background-color: rgba(181, 194, 202, 1);
padding: 7px;
color: #fff;
text-align: center;
}
.homepgintro img {
display: block;
width: 150px;
margin: 0 auto;
border-radius: 100px;
}
What's going wrong? Here is the entire CSS code for my stylesheet (the version that is currently working as expected):
/* UNIVERSAL STYLES */
#page {
max-width: 1200px;
width: 85%;
left: 7.5%;
position: relative;
margin-top: 100px;
background-color: #D9C6C1;
border-radius: 25px;
overflow: hidden;
}
body {
font-family: 'Roboto Slab', Georgia, serif;
font-size: 16px;
background-color: white;
color: #fff;
}
h1 {
font-family: 'Pacifico', cursive;
font-size: 3em;
padding: 4px;
}
h2 {
font-family: 'Sunshiney', 'Comic Sans MS', cursive;
font-size: 2em;
margin: 0;
}
section {
padding: 10px;
}
/* STELLA SAYS */
.stellasays img {
border-radius: 100%;
width: 220px;
float: right;
}
/* NAVIGATION */
nav {
background-color: white;
top: 0;
left: 0;
width: 100%;
margin-bottom: 60px;
position: fixed;
z-index: 100;
}
nav li {
display: inline-block;
padding: 7px;
margin-top: 6px;
}
nav a {
font-family: 'Pacifico', cursive;
color: #cef0de;
border-bottom: 1px solid #cef0de;
text-decoration: none;
padding: 4px;
font-size: 1.3em;
transition: color 0.4s ease-in-out 0.2s;
}
nav a:hover, nav a:focus {
color: #E9BE68;
border-bottom: 1px solid #E9BE68;
}
/* HOMEPAGE STYLES */
header {
width: 100%;
height: 511px;
background: url('cakesresized.jpg') no-repeat;
margin: 10px 0px;
}
.homepgintro {
font-size: 0.9em;
position: absolute;
left: 65%;
height: 22em;
width: 22em;
background-color: rgba(181, 194, 202, 1);
padding: 7px;
color: #fff;
text-align: center;
}
.homepgintro img {
display: block;
width: 150px;
margin: 0 auto;
border-radius: 100px;
}
Related
I am currently working on a website and I have an element that I have explicitly declared: display: inline-block and visibility: visible however, the element is still invisible. This is only occurring on mobile devices. The invisible element is <div id="clock">.
#font-face {
font-family: 'bitwise';
src: url('bitwise.ttf');
font-display: swap;
}
* {
font-family: 'bitwise', monospace;
margin: 0;
padding: 0;
outline: 0;
}
:root {
background-color: #008080;
}
body,
html,
.wrapper {
width: 100%;
height: 100%;
}
span {
color: #FFFFFF;
font-size: 18pt;
text-align: center;
display: inline-block;
}
h1 {
color: #FFFFFF;
text-align: center;
display: inline-block;
}
input {
font-family: 'bitwise', monospace;
background-color: #535353;
color: #FFFFFF;
font-size: 18pt;
overflow: hidden;
text-align: center;
line-height: inherit;
height: inherit;
}
img:not(.noresize) {
width: 35%;
height: 35%;
}
video {
width: 35%;
height: 35%;
}
a:link {
color: #EFCF7C;
}
a:visited {
color: #105733;
}
button {
background-color: #105733;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px 2px;
}
#back {
background-color: #660000;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
margin: 4px 2px;
}
#taskbar {
position: absolute;
overflow: hidden;
bottom: 0;
width: 100%;
height: 27px;
background-color: silver;
box-shadow: inset 0px 1px #dfdfdf, inset 0px 2px #ffffff;
}
.center {
display: flex;
flex-wrap: wrap;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
text-align: center;
align-items: center;
justify-content: center;
}
#start {
float: left;
}
#clock {
float: right;
position: relative;
text-align: center;
}
#clocktime {
font-family: 'Arial', serif;
font-size: 13px;
color: #000000;
position: relative;
bottom: 23px;
left: 17px;
}
#icons {
padding-top: 8px;
}
#content {
padding-top: 10px;
}
.break {
flex-basis: 100%;
height: 0;
}
#content {
width: 675px;
height: 300px;
}
#media screen and (max-width: 1079px) {
html,
body {
overflow: hidden;
}
#clock {
float: right;
position: relative;
bottom: 100px;
text-align: center;
display: inline-block;
visibility: visible;
}
#clocktime {
font-family: 'Arial', serif;
font-size: 13px;
color: #000000;
position: relative;
bottom: 23px;
left: 17px;
}
}
<div id="taskbar">
<div id="start"><img class="noresize" src="/assets/start.png"></div>
<div id="clock"><img class="noresize" src="/assets/clock.png">
<div id="clocktime"></div>
</div>
</div>
<div id="icons"><img class="noresize" src="/assets/icons.png"></div>
<div class="center"><img class="noresize" src="/assets/ie.png"></div>
<div class="center" id="content">
Content here.
</div>
Screenshot 1 - What the page should look like. Note the clock in the lower-right corner.
Screenshot 2 - What the page actually looks like on mobile.
Screenshot 3 - Chrome DevTools showing the element as being in a visible spot, but still not being visible.
I see that that css is only appliable when max-width is equal to 1079px.
Try to increase that number in inspector element to see what happens.
So it turns out I had overflow: hidden set on #taskbar and this means that any children inside of the taskbar will not display, even if they are in a "visible" area. Adding bottom: 32px to set it inside of the taskbar worked.
Updated CSS:
#taskbar {
position: absolute;
overflow: hidden;
bottom: 0;
width: 100%;
height: 27px;
background-color: silver;
box-shadow: inset 0px 1px #dfdfdf, inset 0px 2px #ffffff;
}
<snip>
#media screen and (max-width: 1079px) {
#clock {
bottom: 32px;
}
}
I'm trying to make a simple website for a homework.
This is how the site looks like on google chrome.
At first, I used px instead of '%' for my website, then changed it because turned out it looked different on different browsers. After I used '%', I was satisfied because it looked the same, but then I tried to open it on my phone's google chrome and this is how it looks
I tried using the meta viewport, but that only made it worse. All the element overlaps with each other. My friends didn't use any media queries and their sites still looked alright on both mobile and desktop (fonts looked smaller and everything, but the layout was still alright).
here's the css code:
<style>
.header{
background-image: url("https://www.blibli.com/friends/assets/masakan-indonesia-featured-696x464.jpg");
position: absolute;
height: 25%;
width: 99%;
text-align: center;
filter: blur(2px);
-webkit-filter: blur(2px);
}
.headertext{
font-family: Bebas Neue;
font-size: 4.5em;
top: 7%;
left: 28%;
position: absolute;
color: white;
z-index: 1;
text-decoration: none;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: chocolate;
overflow: hidden;
position: absolute;
width: 99%;
top: 26.5%;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: white;
text-align: center;
padding: 1% 9.92%;
text-decoration: none;
font-size: 1.373em;
font-family: Roboto;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add an active class to highlight the current page */
.topnav a.active {
color: white;
}
/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
display: none;
}
.sidebar{
width: 20%;
height: 107%;
float: left;
display: block;
top: 40%;
position: absolute;
background-color: rgba(148, 145, 141, 0.37);
}
.main{
width: 76.3%;
height: 220%;
display: block;
position: absolute;
top: 40%;
left: 23%;
background-color: rgba(148, 145, 141, 0.37);
}
.box{
border:1px solid red;
position:absolute;
width:80%;
height:22%;
left: 5%;
transition: 0.2s;
}
.box:hover{
transform: scale(1.05);
}
.top{
top: 3%;
}
.middle{
position: absolute;
top: 31%;
}
.bottom{
position:absolute;
bottom:19%
}
.picture{
object-fit: cover;
width: 50%;
height: 85%;
position: absolute;
top: 7.5%;
left: 3%;
}
.text {
width: 40%;
height: 80%;
position: absolute;
top: 7.5%;
right: 4%;
font-family: Roboto;
font-size: 0.9em;
text-align: justify;
}
.judul{
font-family: Bebas Neue;
font-size: 1.6em;
line-height: 2;
letter-spacing: 0.3em;
}
.link{
bottom: 0px;
position: absolute;
font-family: Roboto;
font-size: 0.7em;
}
.button{
text-decoration: none;
display: inline-block;
padding: 1.5% 10%;
position: absolute;
bottom: 7%;
left: 35%;
font-family: Roboto;
font-size: 1.2em;
}
.button:hover{
background-color: white;
color: black;
}
.more{
background-color: chocolate;
color: white
}
.rekomendasi{
display: block;
position: absolute;
width: 96%;
height: 5%;
font-size: 1.8em;
font-family: Bebas Neue;
padding: 2%;
background-color: chocolate;
text-align: center;
letter-spacing: 0.1em;
color: white;
}
.rekomendasicontent{
position: absolute;
top: 85%;
font-size: 0.6em;
text-align: left;
font-family: Roboto;
letter-spacing: 0em;
color: black;
line-height: 160%;
}
.populer{
display: block;
position: relative;
top: 49%;
width: 96%;
height: 5%;
font-size: 1.8em;
font-family: Bebas Neue;
padding: 2%;
background-color: chocolate;
letter-spacing: 0.1em;
color: white;
text-align: center;
}
.populercontent{
font-size: 0.6em;
text-align: left;
font-family: Roboto;
letter-spacing: 0em;
position: absolute;
top:85%;
color: black;
line-height: 160%;
}
.link2{
color: black;
text-decoration: none;
background-color: none;
}
li{
transition: 0.2s;
}
li:hover{
transform: scale(1.1);
}
.footer{
width: 97.8%;
position: absolute;
top: 260%;
background-color: chocolate;
font-family: Roboto;
font-size: 1em;
color: white;
text-align: center;
padding: 0.5%;
}
</style>
I'm fairly new to html, and when I tried to create a webpage, I encountered a problem. I managed to make a navigation bar with a drop down menu directly under the "Games" section, but if I scroll down and open the drop down menu, it no longer opens directly under the navigation bar. This is my HTML code.
<div class="wrapper">
<div id="main-title">
<header>
<h1>Max Reviews</h1>
</header>
</div> <!-- Title box-->
<div id="nav"> <!-- Navigation Bar -->
<nav>
<ul>
<li><a class="active" href="#">Home</a></li>
<li>About Me</li> <!-- Link to about page -->
<li class="drop">
<p>Games</p>
<div class="drop-content">
<p>Red Faction: Guerrilla</p> <!-- Contains links to the respective pages -->
<p>Way of the Samurai 3</p>
<p>Singularity</p>
</div>
</li>
<li>Reviews</li>
<li>External Store</li> <!-- Link to external site -->
<li>Videos</li> <!-- Contains links to Youtube -->
</ul>
</nav>
</div>
<div class="image"> <!-- Banner-->
<a href="singularity.html">
<img src="modified singularity aging 1.jpg" alt="singularity">
<h2><span>Recommended Game of the Month</span></h2>
</a>
</div>
<div id="home-content"><p>Learn more about the site ☛here☚</p></div>
<div id="footer">
<p>© Copyright 2016-2017. All images here were taken and edited by me. All rights reserved. Games featured here might not be suitable for all audience.</p>
</div>
</div>
And this is the stylesheet.
article, body, div, footer, header, h1, h2, p {
border: 0;
padding: 0;
margin: 0;
}
html, body {
height: 100%;
margin: 0;
width: 100%;
background-color: #FFFFFF;
padding: 0px;
overflow-x: hidden;
}
body {
transition: background 600s ease-in-out;
}
body:hover {
background-color: #4B0101;
}
/*main title*/
#main-title {
background-color: #33B2E7;
color: #FFFFFF;
position: relative;
top: 25px;
left: 20px;
padding: 10px;
margin-left: 10px;
display: inline-block;
transition: color 1s, transform 1s;
transition-delay: 2s;
}
#main-title:hover {
color: black;
transform: rotate(360deg);
}
/* Nav */
#nav nav{
padding-top: 100px;
margin-bottom: 0;
}
#nav ul {
list-style-type: none;
margin: 0;
overflow: hidden;
background-color: #1C86EE;
padding: 0;
position: relative;
width: 100%;
bottom: 40px;
display: inline-block;
}
#nav li {
float: left;
width: 16%;
}
li a, .dropbtn {
display: inline-block;
color: #FFFFFF;
text-align: center;
padding-left: 50px;
padding-right: 50px;
text-decoration: none;
}
.active {
background-color: #6CCC0A;
padding-right: 50px;
}
li a:hover, .drop:hover .dropbtn {
background-color: #BFA811;
}
a {
padding-top: 10px;
padding-bottom: 10px;
}
li.drop {
display: inline-block;
}
.drop-content {
display: none;
position: absolute;
background-color: #970707;
min-width: 50px;
box-shadow: 0px 8px 16px 0px #000000;
z-index: 100;
}
.drop-content a {
color: #FFFFFF;
padding: 15px 20px;
display: block;
text-align: left;
}
.drop-content a:hover {
background-color: #02BBC4
}
.drop:hover .drop-content {
display: block;
position: fixed;
top: 155px;
border: 1px solid black;;
}
/*banner*/
.image {
position: relative;
width: 100%;
}
.image h2 {
position: absolute;
top: 600px;
text-align: center;
width: 100%;
right: 350px;
}
.image h2 span {
color: #FFFFFF;
font: Arial, Calibri, Sans-serif;
background: #000000;
padding: 10px;
}
.image h2:hover span {
background-color: #003316;
}
.button {
position: absolute;
top: 1013px;
left: 700px;
padding: 16px 32px;
text-align: center;
margin: 4px 2px;
display: inline-block;
cursor: pointer;
background-color: rgb(41,120,104);
color: rgb(240,144,22);
font-family: Cambria, Times New Roman, serif;
font-size: 20px;
}
/*content*/
#home-content {
position: relative;
padding: 20px;
text-align: center;
margin-left: 90px;
display: block;
color: #8A0707
}
#home-content a {
color: #09922A
}home-content a:visited {
color: #000000
}
/*Footer*/
#footer {
background: #000000;
width: 100%;
height: 40px;
position: relative;
bottom: 0;
left: 0;
padding-top: 10px;
overflow: hidden;
}
#footer p {
font-family: arial, calibri, sans-serif;
color: #FFFFFF;
text-align: center;
}
#aboutme h2 {
margin-bottom: 20px;
text-align: center;
text-decoration: underline;
font-family: Cambria, Calibri, sans-serif;
font-size: 20px;
color: #000000;
}
#aboutme article {
padding-top: 20px;
position: relative;
margin-left: 25%;
margin-right: 25%;
display: inline-block;
font-family: arial, cambria, serif;
line-height: 200%;
color: #777000;
text-align: center;
border: 2px solid #000000;
padding: 10px;
}
#gallery-title {
text-align: center;
font-family: Cambria, calibri, sans-serif;
padding-top: 20px;
}
#image-1 {
text-align: center;
margin: 0 25%;
padding: 20px;
}
.img-desc-1 {
padding: 20px;
color: #047615;
}
#image-2 {
text-align: center;
margin: 0 25%;
border: 2px solid #262020;
padding: 20px;
}
#prompt-text {
text-align: center;
padding-top: 30px;
font-family: cambria, calibri, sans-serif;
}
.image-container img{
height: 300px;
width: 300px;
padding-left: 60px;
padding-top: 60px;
}
.image-container p{
padding-left: 80px;
font-family: Arial, cambria, sans-serif;
color: #560404;
text-decoration: none;
}
.image-container {
display: block;
text-align: center;
padding-left: 20px;
}
#image1 {
padding-right: 60px;
padding-bottom: 10%
}
#image2 {
padding-right: 60px;
padding-bottom: 10%;
}
#image3 {
padding-bottom: 0;
margin: 0;
}
.gameimages {
padding-bottom: 15%;
text-align: center;
}
.gameimages p {
padding-top: 20px;
}
.gameimages h3 {
text-align: center;
font-family: cambria, times new roman, sans-serif
}
#side-nav {
height: 200px;
float: right;
bottom: 1500px;
right: 3%;
padding: 10px;
background-color: #8C3406;
display: block;
position: relative;
text-align: center;
}
Please help me as I've been trying to solve this problem for 2 days. Also, this is my first time posting a question here, so forgive me if I indented my code wrongly, or if I inadvertently violated some of the rules of Stack Overflow.
The reason for this behaviour is that your drop-content has position:fixed on hover.
From MDN:
…an element that is absolutely positioned is taken out of the flow; thus, other elements are positioned as if it did not exist. The absolutely positioned element is positioned relative to its nearest positioned ancestor… Fixed positioning is similar to absolute positioning, with the exception that the element's containing block is the viewport.
Working example on JSFiddle and here is what I've changed:
#nav ul {
/*overflow: hidden;*/
}
.drop:hover .drop-content {
/*position: fixed;
top: 155px;*/
position: absolute;
}
Update CSS to
article, body, div, footer, header, h1, h2, p {
border: 0;
padding: 0;
margin: 0;
}
html, body {
height: 100%;
margin: 0;
width: 100%;
background-color: #FFFFFF;
padding: 0px;
overflow-x: hidden;
}
body {
transition: background 600s ease-in-out;
}
body:hover {
background-color: #4B0101;
}
/*main title*/
#main-title {
background-color: #33B2E7;
color: #FFFFFF;
position: relative;
top: 25px;
left: 20px;
padding: 10px;
margin-left: 10px;
display: inline-block;
transition: color 1s, transform 1s;
transition-delay: 2s;
}
#main-title:hover {
color: black;
transform: rotate(360deg);
}
/* Nav */
#nav nav{
padding-top: 100px;
margin-bottom: 0;
}
#nav ul {
list-style-type: none;
margin: 0;
background-color: #1C86EE;
padding: 0;
position: relative;
width: 100%;
bottom: 40px;
display: inline-block;
}
#nav li {
float: left;
width: 16%;
}
li a, .dropbtn {
display: inline-block;
color: #FFFFFF;
text-align: center;
padding-left: 50px;
padding-right: 50px;
text-decoration: none;
}
.active {
background-color: #6CCC0A;
padding-right: 50px;
}
li a:hover, .drop:hover .dropbtn {
background-color: #BFA811;
}
a {
padding-top: 10px;
padding-bottom: 10px;
}
li.drop {
display: inline-block;
}
.drop-content {
display: none;
position: absolute;
background-color: #970707;
min-width: 50px;
box-shadow: 0px 8px 16px 0px #000000;
z-index: 100;
}
.drop-content a {
color: #FFFFFF;
padding: 15px 20px;
display: block;
text-align: left;
}
.drop-content a:hover {
background-color: #02BBC4
}
.drop:hover .drop-content {
display: block;
}
/*banner*/
.image {
position: relative;
width: 100%;
}
.image h2 {
position: absolute;
top: 600px;
text-align: center;
width: 100%;
right: 350px;
}
.image h2 span {
color: #FFFFFF;
font: Arial, Calibri, Sans-serif;
background: #000000;
padding: 10px;
}
.image h2:hover span {
background-color: #003316;
}
.button {
position: absolute;
top: 1013px;
left: 700px;
padding: 16px 32px;
text-align: center;
margin: 4px 2px;
display: inline-block;
cursor: pointer;
background-color: rgb(41,120,104);
color: rgb(240,144,22);
font-family: Cambria, Times New Roman, serif;
font-size: 20px;
}
/*content*/
#home-content {
position: relative;
padding: 20px;
text-align: center;
margin-left: 90px;
display: block;
color: #8A0707
}
#home-content a {
color: #09922A
}home-content a:visited {
color: #000000
}
/*Footer*/
#footer {
background: #000000;
width: 100%;
height: 40px;
position: relative;
bottom: 0;
left: 0;
padding-top: 10px;
overflow: hidden;
}
#footer p {
font-family: arial, calibri, sans-serif;
color: #FFFFFF;
text-align: center;
}
#aboutme h2 {
margin-bottom: 20px;
text-align: center;
text-decoration: underline;
font-family: Cambria, Calibri, sans-serif;
font-size: 20px;
color: #000000;
}
#aboutme article {
padding-top: 20px;
position: relative;
margin-left: 25%;
margin-right: 25%;
display: inline-block;
font-family: arial, cambria, serif;
line-height: 200%;
color: #777000;
text-align: center;
border: 2px solid #000000;
padding: 10px;
}
#gallery-title {
text-align: center;
font-family: Cambria, calibri, sans-serif;
padding-top: 20px;
}
#image-1 {
text-align: center;
margin: 0 25%;
padding: 20px;
}
.img-desc-1 {
padding: 20px;
color: #047615;
}
#image-2 {
text-align: center;
margin: 0 25%;
border: 2px solid #262020;
padding: 20px;
}
#prompt-text {
text-align: center;
padding-top: 30px;
font-family: cambria, calibri, sans-serif;
}
.image-container img{
height: 300px;
width: 300px;
padding-left: 60px;
padding-top: 60px;
}
.image-container p{
padding-left: 80px;
font-family: Arial, cambria, sans-serif;
color: #560404;
text-decoration: none;
}
.image-container {
display: block;
text-align: center;
padding-left: 20px;
}
#image1 {
padding-right: 60px;
padding-bottom: 10%
}
#image2 {
padding-right: 60px;
padding-bottom: 10%;
}
#image3 {
padding-bottom: 0;
margin: 0;
}
.gameimages {
padding-bottom: 15%;
text-align: center;
}
.gameimages p {
padding-top: 20px;
}
.gameimages h3 {
text-align: center;
font-family: cambria, times new roman, sans-serif
}
#side-nav {
height: 200px;
float: right;
bottom: 1500px;
right: 3%;
padding: 10px;
background-color: #8C3406;
display: block;
position: relative;
text-align: center;
}
2 changes done.
Removed overflow:hidden in #nav ul
Keot display:block only in .drop:hover .drop-content
I published a working version of my site to my wwwroot folder, but when I open the website some of the design is missing.
I looked in devTools (sources) in chrome and noticed that there are parts of my css that are missing, when I open the css manualy from the wwwroot folder I see that the parts are actualy there.
What might cause a selective css load?
The missing part of my css file:
#layer {
background: url(http://s14.directupload.net/images/111129/44ga9qid.png);
height: 550px;
background-repeat: repeat;
position: absolute;
z-index: 3;
width: 100%;
top: 0;
left: 0;
}
#slide {
position: relative;
z-index: 1;
}
.menufixed {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 99999;
border-bottom: chocolate 8px solid;
background-color: rgb(0, 0, 0);
box-shadow: 0 0 10px black;
}
The whole css file as published to the wwwroot folder:
.menu_item {
color: #FFFFFF;
border-top: 4px solid #B6B5B5;
display: inline-block;
font-family: Arial;
font-variant: small-caps;
font-weight: normal;
padding: 5px 2px 0px 2px;
text-decoration: none;
/* font-weight: bold; */
letter-spacing: 2px;
margin: 5px;
}
#Top {
border-bottom: chocolate 8px solid;
/* margin-bottom: 3%; */
background-color: rgb(0, 0, 0);
box-shadow: 0 0 10px black;
}
a {
text-decoration: none;
color: #5E5E5E;
}
#Logo {
color: #5E5E5E;
font-family: 'Reenie Beanie', cursive;
display: inline-block;
margin-right: 3vw;
background: url(http://www.elinorart.com/Gallery/latest%20artworks/slides/93.jpg) no-repeat, #5E5E5E;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
h1 {
font-size: 70px;
margin: 5% 0;
}
h1:hover {
color: chocolate;
}
a:hover, a div:hover {
color: chocolate;
}
#menu_bar {
display: inline-block;
}
#contact_text {
width: 50%;
margin-left: auto;
margin-right: auto;
padding-bottom: 10px;
/* font-weight: 600; */
font-size: 16px;
/* font-family: -webkit-pictograph; */
color: #5E5E5E;
/* letter-spacing: 0px; */
}
#bottom_left p {
padding: 0px 49px 0 64px;
}
#bottom_center p {
padding: 0px 62px 0 30px;
}
#contact_details {
padding-bottom: 10px;
color: #5E5E5E;
font-size: 16px;
}
#pageFooter {
font-size: 0.8em;
color: #5E5E5E;
text-align: center;
font-family: Arial;
margin-top: 10%;
}
li {
line-height: 24px;
font-family: Arial;
color: #1C1C1C;
font-size: 16px;
list-style-type: none;
}
.exhibit_name {
color: black;
}
#page {
text-align: center;
background-color: rgb(232, 232, 232);
}
.page_content {
font-family: Arial;
/*text-align: initial;*/
/* background-color: rgb(232, 232, 232); */
/* padding-top: 3%; */
}
p {
font-size: 16px;
font-family: Arial;
}
#media screen and (max-width: 768px) {
body {
background-color: lightblue;
}
}
body.about_me {
background-color: green;
}
.borderClass {
border-color: chocolate;
}
#contactDiv {
display: inline-block;
}
td {
vertical-align: top;
}
.contact_field {
border-bottom-width: 1px;
border: 1px solid #5E5E5E;
border-radius: 4px;
font-size: 16px;
font-family: Arial, cursive;
width: 322px;
height: 24px;
}
.contact_field_desc {
font-size: 14px;
padding: 4px;
font-family: Arial;
text-align: left;
}
.send_form {
border-bottom-width: 1px;
border: 1px solid #5E5E5E;
border-radius: 4px;
padding: 5px 28px;
}
body {
margin: auto;
}
#Facebook {
/* width: 100%; */
/* text-align: center; */
/* margin-left: 40%; */
/* margin-top: 3%; */
display: inline-flex;
margin-top: 2%;
}
#fb-root {
/*float: left;*/
vertical-align: central;
margin-right: 10px;
}
#fb-root2 {
/*float: right;*/
vertical-align: central;
margin-left: 10px;
}
.fb_iframe_widget {
/* margin-right: 13px; */
/* float: left; */
padding-right: 10%;
}
.exhibitions {
width: 40%;
margin: 0 5%;
float: left;
/*text-align: left;*/
}
.wrapper {
display: inline-block;
width: 45%;
text-align: left;
}
.exhibitions_wrapper {
padding-right: 3%;
}
ul {
padding: 0px;
}
ul li ul li {
list-style-type: initial;
padding-bottom: 10px;
}
.exhibitions_year {
/* margin-left: -5%; */
font-family: 'Reenie Beanie', cursive;
font-size: 37px;
/* line-height: 1px; */
margin: 14px 0;
color: orange;
color: chocolate;
font-weight: 500;
letter-spacing: 4px;
}
.bottom_sections {
width: 25%;
/* height: 100%; */
vertical-align: top;
text-align: left;
display: inline-block;
/* padding: 2%; */
}
.bottom_content {
/* padding: 0 10%; */
text-align: center;
}
.buttom_text {
font-size: 13px;
line-height: 25px;
padding: 0 10%;
text-align: left;
}
#AboutMe p {
font-size: 13px;
line-height: 25px;
}
.contact_info {
display: inline-block;
width: 19%;
vertical-align: top;
padding-left: 30px;
}
#exhibitions_wrapper {
width: 70%;
}
#AboutMe .wrapper {
border-right: 1px solid lightgray;
padding-right: 30px;
}
h3 {
padding-top: 3%;
margin: 12px 0;
font-variant: small-caps;
font-size: 37px;
font-weight: normal;
color: dimgrey;
letter-spacing: 10px;
font-family: Arial;
}
h4 {
font-size: 24px;
color: dimgrey;
font-variant: small-caps;
font-weight: normal;
}
h5 {
margin-top: 30px;
/* padding: 15px; */
border-bottom: 1px solid black;
font-size: 24px;
color: dimgrey;
font-variant: small-caps;
font-weight: normal;
text-align: center;
}
h2 {
/* padding: 0; */
margin-top: 12px;
font-variant: small-caps;
font-size: 32px;
font-weight: normal;
color: dimgrey;
letter-spacing: 10px;
font-family: Arial;
}
#AboutMe .contact_field {
width: 187px;
}
input {
margin-bottom: 15px;
}
.gallery_homepage {
height: 550px;
position: absolute;
z-index: 2;
top: 0;
left: 0;
}
.gallery_homepage div {
height: 550px;
}
#layer {
background: url(http://s14.directupload.net/images/111129/44ga9qid.png);
height: 550px;
background-repeat: repeat;
position: absolute;
z-index: 3;
width: 100%;
top: 0;
left: 0;
}
#slide {
position: relative;
z-index: 1;
}
.menufixed {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 99999;
border-bottom: chocolate 8px solid;
background-color: rgb(0, 0, 0);
box-shadow: 0 0 10px black;
}
Thanks!
There can be many reasons for it:
Your CSS rule might be overridden by inline style
It may be overridden by other preceding rule (in the later lines) in the same CSS file
You might be over ridding the css using ' !important' (this can be seen in dev tools)
You might have an error in your CSS file such as wrong syntax or missing ';' after rule or missing '{' or '}' at the beginning or end block of rules
Last but not least you might not be including the (correct) CSS file properly in the html
Hope this helps.
I just had a similiar problem: I updated a HTML and a CSS file and uploaded it to the server. When reloading in the browser, the updates in the HTML file showed but those in the CSS didn't. That was because of the way the browser (in my case Chrome) is caching. When opening in an Inkognito-Tab or deleting the cache it did work.
With character: http://jsfiddle.net/nuu6g/
For some reason, I cannot click on my text on my navigation menu. This is most likely due to the (missing) image on the left, which I will refer to as the "character." However, when I remove the character, I can indeed click on the text again.
Without character: http://jsfiddle.net/aN5s5/
body {
background:grey;
}
.topContainer {
width: 1000px;
height: 125px;
margin: 0 auto;
padding-bottom: 20px;
}
#logo {
float: left;
padding: 10px 10px;
}
/* Navigation */
#navigation {
background: #107AEB;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#107AEB), to(#106FEB));
background: -webkit-linear-gradient(top, #107AEB, #106FEB);
background: -moz-linear-gradient(top, #107AEB, #106FEB);
background: -ms-linear-gradient(top, #107AEB, #106FEB);
background: -o-linear-gradient(top, #107AEB, #106FEB);
border: 2px solid rgba(16, 86, 235, 0.9);
border-radius: 15px;
float: right;
width: 455px;
height: 55px;
margin-top: 22px;
z-index: 1;
}
#navigation ul {
display: inline-block;
position: absolute;
list-style-type: none;
}
#navigation li {
display: inline-block;
}
#navigation a {
color: #FFF;
font-family: SEGOEUIL, Arial, sans-serif;
text-shadow: 0 1px 0 #000;
text-align: center;
padding: 5px 10px;
font-size: 17px;
}
#navigation a:hover {
background: rgba(16, 86, 235, 0.9);
border-radius: 5px;
}
#navigation a:active {
text-decoration: none;
}
#navigation a:link {
text-decoration: none;
}
.character {
z-index: 2;
padding: 0 275px;
float: left;
position: absolute;
width: 187px;
height: 174px;
}
/* Wrapper */
#wrapper {
background: #FFF;
/*rgba(255, 255, 255, 0.85);*/
border-top-left-radius: 25px;
border-top-right-radius: 25px;
width: 1000px;
height: 1200px;
position: relative;
z-index: 3;
overflow: hidden;
margin: 0 auto;
}
#photoContent {
background: #ffcc00;
border: 1px solid #b62100;
border-radius: 8px;
width: 781px;
height: 231px;
margin-top: 12px;
display: block;
margin-left: auto;
margin-right: auto;
}
.displayPhoto {
width: 771px;
height: 221px;
border: 0;
border-radius: 8px;
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 3px;
border: 1px solid #b62100;
}
#leftContent {
padding-top: 15px;
width: 500px;
height: 140px;
float: left;
padding-left: 45px;
}
.title {
font-family: Arial, sans-serif;
color: #3abfee;
font-size: 20px;
}
.desc {
color: #575757;
font-size: 15px;
font-family: Arial, sans-serif;
}
#rightContent {
padding-top: 15px;
width: 300px;
height: 140px;
float: right;
padding-right: 25px;
}
#flashContent {
padding-left: 25px;
width: 700px;
height: 500px;
}
hr {
width: 750px;
height: 1px;
background: #CCC;
border: none;
margin-top: 10px;
}
/* Bottom Wrapper */
#bwCont {
width: 1000px;
height: 500px;
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 10px;
}
.galleryCont {
display: block;
margin-left: auto;
margin-right: auto;
width: 650px;
height: 150px;
}
.galleryImgCont {
width: 175px;
height: 175px;
float: left;
}
.galleryTitle {
font-family:'Exo 2', sans-serif;
font-size: 17px;
color: #333;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
padding-top: 145px;
}
.galleryDesc {
font-family:'Exo 2', sans-serif;
font-size: 15px;
color: #333;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
#galleryImg {
width: 175px;
height: 125px;
border: 5px solid #F5F5F5;
box-shadow: 0 0 7px;
border-radius: 5px;
float: left;
}
.readMore {
width: 175px;
height: 50px;
background: #000;
border: 0;
border-radius: 5px;
padding: 10px 10px;
color: #FFF;
font-family:'SEGOEUIL', sans-serif;
font-size: 17px;
}
.readMore:hover {
background: #202020;
}
Please help me, thanks! Also, just an extra question; is there any way I can keep the read more buttons inline, instead of like a staircase? Sorry, but thank you!
For your links to be "clickable", either adjust the padding/width of #character or use the following CSS so #navigation comes up top of #character
#navigation {
z-index: 3;
position: relative;
}
DEMO
For "Read More" to be aligned, you're going to need to have the same number of lines in the title and the description, or you can set a minimum height (or even just the height) of those by adding the following CSS for eaxmple:
.galleryTitle {
min-height:40px;
}
.galleryDesc {
min-height:60px;
}
DEMO
Your nav items are displaying in a staircase because there is not enough room due to the width of your ul. adding width 100% will allow them to display inline the way you want.
#navigation ul {
width: 100%
}
the reason you can't click your text link is because of your character class overlaying your images with a higher z-index.