I've been working on my project, so initially, I want if the .box div is being hovered, the text inside the div (h4 and p) is turning to white. But it doesn't even though I've used (~) in my CSS. I think there's a problem in my hierarchy of the HTML document. Here's my part of my code, anyway yes, I've read the other page about Hover one element, change other and I've tried everything there and nothing change. Can anyone help me? Thanks.
.box{
width: 157px;
height: 95px;
background: #FFFFFF;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
border-radius: 12.5px;
overflow: hidden;
}
.title-box{
position: relative;
top: 17px;
text-align: center;
font-family: Product Sans;
font-style: normal;
font-weight: bold;
font-size: 20px;
line-height: 24px;
text-align: center;
letter-spacing: 0.02em;
color: #E67E22;
}
.tc-1{
position: relative;
top: 26px;
left: 33px;
font-family: Product Sans Light;
font-style: normal;
font-weight: 300;
font-size: 12px;
line-height: 16px;
letter-spacing: 0.02em;
color: #000000;
}
.tc-2{
position: relative;
top: 26px;
left: 14px;
font-family: Product Sans;
font-style: normal;
font-weight: bold;
font-size: 14px;
line-height: 16px;
letter-spacing: 0.00em;
color: #000000;
}
.tc-3{
position: relative;
top: -6px;
left: 110px;
font-family: Product Sans Light;
font-style: normal;
font-weight: 300;
font-size: 12px;
line-height: 16px;
letter-spacing: 0.02em;
color: #000000;
}
.tc-4{
position: relative;
top: -6px;
left: 88px;
font-family: Product Sans;
font-style: normal;
font-weight: bold;
font-size: 14px;
line-height: 16px;
letter-spacing: 0.00em;
color: #000000;
}
.box:hover{
background: #E67E22;
transition: 0.5s;
color: white;
}
.box:hover ~ h4, p{
color: white;
}
<html>
<head>
<title>Stock Kompor</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style-in1.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
</head>
</html>
<body>
<div class="big-container">
<div class="title">
<span class="title-text">Kompor</span>
</div>
<nav id="wrapper">
<div onclick="deleteOps()" class="box">
<h4 class="title-box">Rinnai 522-E</h4>
<p class="tc-1">HB</p>
<p class="tc-2">313.000</p>
<p class="tc-3">HJ</p>
<p class="tc-4">345.000</p>
</div>
</nav>
</div>
</body>
<script src="js-in1.js"></script>
</html>
those elements are not siblings but children of .box, thus the style should be
.box:hover h4,
.box:hover p {
color: white;
}
the general sibling combinator (~) would match instead any following sibling elements of .box.
.box{
width: 157px;
min-height: 95px;
background: #FFFFFF;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
border-radius: 12.5px;
overflow: hidden;
}
.title-box{
position: relative;
top: 17px;
text-align: center;
font-family: Product Sans;
font-style: normal;
font-weight: bold;
font-size: 20px;
line-height: 24px;
text-align: center;
letter-spacing: 0.02em;
color: #E67E22;
}
.tc-1{
position: relative;
top: 26px;
left: 33px;
font-family: Product Sans Light;
font-style: normal;
font-weight: 300;
font-size: 12px;
line-height: 16px;
letter-spacing: 0.02em;
color: #000000;
}
.tc-2{
position: relative;
top: 26px;
left: 14px;
font-family: Product Sans;
font-style: normal;
font-weight: bold;
font-size: 14px;
line-height: 16px;
letter-spacing: 0.00em;
color: #000000;
}
.tc-3{
position: relative;
top: -6px;
left: 110px;
font-family: Product Sans Light;
font-style: normal;
font-weight: 300;
font-size: 12px;
line-height: 16px;
letter-spacing: 0.02em;
color: #000000;
}
.tc-4{
position: relative;
top: -6px;
left: 88px;
font-family: Product Sans;
font-style: normal;
font-weight: bold;
font-size: 14px;
line-height: 16px;
letter-spacing: 0.00em;
color: #000000;
}
.box:hover{
background: #E67E22;
transition: 0.5s;
color: white;
}
.box:hover h4, .box:hover p{
color: white;
}
<html>
<head>
<title>Stock Kompor</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style-in1.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
</head>
</html>
<body>
<div class="big-container">
<div class="title">
<span class="title-text">Kompor</span>
</div>
<nav id="wrapper">
<div onclick="deleteOps()" class="box">
<h4 class="title-box">Rinnai 522-E</h4>
<p class="tc-1">HB</p>
<p class="tc-2">313.000</p>
<p class="tc-3">HJ</p>
<p class="tc-4">345.000</p>
</div>
</nav>
</div>
</body>
<script src="js-in1.js"></script>
</html>
My code is quite simple:
<div class="mail-header-title">
${title}
</div>
<div class="mail-header-down-rounded-triangle">
<img src="fill-1#3x.png"/>
</div>
.mail-header-title {
padding: 24px 50px 36px 50px;
width: 591px;
font-family: Arial, sans-serif;
font-size: 42px;
font-weight: bold;
font-stretch: normal;
font-style: normal;
line-height: 1.29;
letter-spacing: normal;
color: #ffffff;
}
.mail-header-content {
padding: 13px 50px 16px 50px;
font-family: Arial, sans-serif;
font-size: 20px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: 1.56;
letter-spacing: normal;
color: #444560;
background-color: #FFFFFF;
border: none !important;
}
.mail-header-down-rounded-triangle {
background-color: #FFFFFF;
text-align: center;
border: 0;
padding-top: 0;
}
.mail-header-down-rounded-triangle img {
height: 24px;
width: 101px;
/*content: url("fill-1#3x.png");*/
}
The first div background is blue, and the second div contains this image below.
I'm sure I set div border as none.
When the page is rendered, everything looks ok. But when I zoom in/out,
this blue line appears.
I'm not sure what happened, any idea about this?
I am trying to vertically center some text contained within divs within another div. For the life of me I cannot get it to work.
Here is a JSfiddle for the code. I want the two pieces of text to be vertically centered between the top of the page and the bottom of the div which is the bottom border.
.logo1 {
font-family: Helvetica;
font-size: 36px;
letter-spacing: -0.05em;
text-align: left;
display: inline-block;
width: 525px;
}
.orange {
color: #e68217;
font-weight: bold;
}
.nav {
color: black;
font-family: Helvetica;
font-size: 18px;
font-weight: bold;
letter-spacing: -0.05em;
text-align: right;
width: 300px;
display: inline-block;
}
div.head {
margin: auto;
width: 850px;
height: 100px;
border-bottom: 3px solid #cccccc;
}
<div class="head">
<div class="logo1">
foo<span class="orange">bar</span>
</div>
<div class="nav">
portfolio
<span style="color: #cccccc">|</span>
about me
<span style="color: #cccccc">|</span>
contact me
</div>
</div>
Use the following CSS code:
.nav {
color: black;
font-family: Helvetica;
font-size: 18px;
font-weight: bold;
letter-spacing: -0.05em;
text-align: right;
display: inline-block;
vertical-align:middle;
width: 300px;
padding-top:38px;
}
I had what seemed like a pretty easy problem to solve, my jumbotron image is not scaled correctly; leaving a rather large image (5560 × 1592) a little bit blurry:
My index.html is the following:
<div class="jumbotron">
<div class="container">
<div class="title">
<astrobox>astrobox</astrobox>
<io>.io</io>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
<br></br>
</div>
<div class="jumbotron_paragraphs">
<p><p1>$Supporting /[] Professional_Astronomers<p1></p>
<p><p2>Serving the research of those studying in the field of astronomy and astrophysics.</p2></p>
<div class="learn_more">
<p>Learn More</p>
</div>
</div>
</div>
</div>
My CSS is:
.jumbotron {
background-image:url('https://farm9.staticflickr.com/8679/16635810101_037dda36eb_s.jpg');
background-color: #000000;
height: 500px;
background-repeat: no-repeat;
background-size: cover;
}
.jumbotron .container {
position: relative;
top:10px;
}
.jumbotron astrobox {
color: #fff;
font-size: 100px;
font-family: 'Basic', sans-serif;
font-weight: bold;
display: inline;
}
.jumbotron io {
color: #fff;
font-size: 48px;
font-family: 'Lobster', sans-serif;
font-weight: bold;
display: inline;
}
.jumbotron .container p {
font-size: 13px;
color: #fff;
text-align: center;
font-family: verdana;
}
.jumbotron_paragraphs p1 {
font-size: 13px;
color: #fff;
text-align: center;
letter-spacing: 4px;
}
.jumbotron_paragraphs p2 {
font-size: 13px;
color: #fff;
text-align: center;
letter-spacing: 4px;
}
Any hints or tips on how to do this would be greatly appreciated.
So flikr seems to be really poor at displaying the image and hosting photos...why have they made their service worse? Dropbox is 100% better for the jumbotron images.
.jumbotron {
background-image:url('https://dl-web.dropbox.com/get/xxx.jpg?_subject_uid=xxx');
height: 520px;
background-repeat: no-repeat;
background-size: cover
}
.jumbotron .title {
text-align: center;
}
.jumbotron .container {
position: relative;
top:10px;
}
.jumbotron astrobox {
color: #ffffff;
font-size: 100px;
font-family: 'Basic', sans-serif;
font-weight: bold;
display: inline;
}
.jumbotron io {
color: #ffffff;
font-size: 48px;
font-family: 'Lobster', sans-serif;
font-weight: bold;
display: inline;
}
.jumbotron .container p {
font-size: 13px;
color: #ffffff;
text-align: center;
font-family: 'Droid Sans', sans-serif;
}
.jumbotron_paragraphs p1 {
font-size: 13px;
color: #ffffff;
text-align: center;
letter-spacing: 4px;
}
.jumbotron_paragraphs p2 {
color: #ffffff;
font-size: 13px;
text-align: center;
letter-spacing: 4px;
}
.jumbotron_paragraphs .jumbotron_image {
padding-bottom: 0px;
margin-bottom: 5px;
}
Please help!
I tried many tricks to remove the white space under my footer but none of them solved my problem. I noticed that the white space is only visible in the pages with text, p and h1 tags. Any help is highly appreciated.
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Olive Green Studio</title>
<link href="oliva.css" rel="stylesheet" type="text/css" />
<!—[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]—>
<!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixLtHdr #sidebar1 { width: 230px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixLtHdr #sidebar1 { padding-top: 30px; }
.twoColFixLtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>
<body class="twoColFixLtHdr">
<div id="container">
<div id="header"><!-- end #header -->
<div id="logo">
<a href="index.html">
<img src="olivaimages/olivegreenlogoweb.png" border="none"/>
</a>
</div>
<div id="sidebar1">
<ul>
<li>Home</li>
<li>Work</li>
<li>About</li>
<li>Contact</li>
</ul>
<!-- end #sidebar1 --></div>
</div>
<div id="mainContent">
<h1>Contact Us </h1>
<p>If you need a creative help or want to take your project to the next level please don't hesitate to drop us a line.</p>
<a class="worklinks" href= "mailto:info#olivegreenstudio.com"> info#olivegreenstudio.com</a>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div class="clearfooter"></div>
<!-- end #container -->
</div>
<div id="footerframe">
<div id="footer">
<div id="footer2">
<div id="address">Khobar<br> Saudi Arabia </div>
<div id="contact">
<strong>Services:</strong><br> Logos<br>Branding<br>Identity<br>Collaterals<br>Packaging<br> Web Design & Development <br>
</div>
<div id="email">
If you have a project inquiry, we will be happy to answer you <a class="contactlink" href="mailto:info#olivegreenstudio.com"> here.</a>
</div>
<div class="social">
<div class="twitter">
<a href="https://twitter.com/OliveGreenSTU" />
<img src="olivaimages/twitterbirdwebgreen.png" onmouseover="this.src='olivaimages/twitterbirdweb-lightgreen.png'" onmouseout="this.src='olivaimages/twitterbirdwebgreen.png'" />
</div>
</a>
<div id="pinterest">
<a href="http://pinterest.com/olivegreenstu/">
<img src="olivaimages/pinterestwebgreen.png" onmouseover="this.src='olivaimages/pinterestweb-lightgreen.png'"
onmouseout="this.src='olivaimages/pinterestwebgreen.png'" />
</a>
</div>
<div class="copywrite"> © 2013 Olive Green. All rights reserved.</div>
</div>
</div>
</div>
</div>
</body>
</html>
CSS:
#charset "UTF-8";
body {
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 100%;
background-color: #FFFFFF;
height: 100%;
}
.twoColFixLtHdr #header {
height: 170px;
background-color: #FFFFFF;
background-repeat: no-repeat;
background-position: center center;
margin: 0px;
padding: 0;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
color: #5A6219;
text-decoration: none;
font-style: normal;
font-weight: normal;
padding-bottom: 20px;
}
h2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: normal;
color: #908B23;
text-decoration: none;
line-height: 1.5em;
margin-bottom: 30px;
}
p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
line-height: 1.5em;
font-weight: normal;
color: #908B23;
text-decoration: none;
margin: 0px;
}
.twoColFixLtHdr #container {
width: 900px;
text-align: left; /* this overrides the text-align: center on the body element. */
min-height: 100%;
margin-top: 0;
margin-right: auto;
margin-left: auto;
position: relative;
margin-bottom: -215px;
height: 100%;
}
.twoColFixLtHdr #mainContent {
height: 100%;
background-color: #FFF;
float: left;
width: 100%;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #CCC;
padding-top: 50px;
padding-bottom: 70px;
}
.workmaincontent {
height: 100%;
background-color: #FFF;
float: left;
width: 100%;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #CCC;
padding-top: 50px;
padding-bottom: 70px;
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
.twoColFixLtHdr #sidebar1 {
float: right; /* since this element is floated, a width must be given */
width: 300px;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 15px;
padding-left: 20px;
margin-top: 70px;
background-color: #FFFFFF;
height: 30px;
}
#sidebar1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
height: 200px;
line-height: 1.5em;
text-decoration: none;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
width: 500px;
}
#sidebar1 ul {
background-color: #FFFFFF;
list-style-type: none;
margin: 0px;
padding: 0px;
}
#sidebar1 li {
display: run-in;
list-style-type: none;
}
#sidebar1 a {
display: run-in;
text-decoration: none;
color: #918C10;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: normal;
padding: 5px;
float: left;
width: 65px;
}
#sidebar1 a:hover {
color: #5A6219;
}
.worklinks{
font-family: Arial, Helvetica, sans-serif;
color: #5A6219;
text-decoration: none;
}
.worklinks:hover{
font-family: Arial, Helvetica, sans-serif;
color: #908B23;
text-decoration: none;
}
#print{
height: 100%;
background-color: #FFF;
width: 730px;
float: left;
padding-right: 15px;
padding-left: 15px;
margin-left: 85px;
margin-right: 85px;
}
#web{
height: 100%;
background-color: #FFF;
width: 730px;
float: left;
padding-right: 15px;
padding-left: 15px;
margin-left: 85px;
margin-top: 50px;
margin-bottom: 50px;
}
#packaging{
background-color: #FFF;
height: 100%;
width: 730px;
float: left;
padding-right: 15px;
padding-left: 15px;
margin-left: 85px;
}
.imagetitles a {
text-decoration: none;
font-family: "Century Gothic";
font-size: 25px;
font-style: normal;
font-weight: normal;
color: #00CCCC;
}
#printtitle{
bottom: -5px;
left: 333px;
}
#webtitle{
position: absolute;
left: 333px;
top: 521px;
}
#packagingtitle{
position: absolute;
left: 317px;
top: 823px;
width: 89px;
}
#bigimages{
width: 570px;
height: 100%;
}
.imagestalk {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-style: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
font-size: 14px;
line-height: 1.5em;
padding-top: 5px;
padding-right: 15px;
padding-bottom: 10px;
padding-left: 20px;
}
.thumbnails {
border: 5px solid #666666;
}
h3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
line-height: 1.5em;
font-weight: normal;
color: #5A6219;
text-decoration: none;
}
h3 a:link {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #000000;
font-style: normal;
font-weight: normal;
text-decoration: none;
}
h3 a:visited {
color: #D0BA0B;
text-decoration: underline;
}
h3 a:hover {
color: #5A6219;
}
h3 a:active {
color: #579835;
}
.back{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-style: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
padding-left: 520px;
}
.back a:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
text-decoration: none;
font-size: 14px;
font-style: normal;
font-weight: normal;
color: #666666;
}
.back a:visited {
color: #666666;
text-decoration: none;
}
.back a:hover {
color: #000000;
text-decoration: none;
}
.back a:active {
color: #333333;
text-decoration: none;
}
.source{
font-size: 15px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-style: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
.workimage {
height: 150px;
width: 200px;
float: left;
margin: 20px;
}
img {
border: 0;
}
#logo {
height: 150px;
width: 300px;
float: left;
}
#footerframe {
width: 100%;
background-color: #AEA03A;
height: 215px;
position: relative;
float: right;
}
#footer {
width: 900px;
font-family: Verdana, Arial, Helvetica;
font-size: 11px;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-decoration: none;
margin-right: auto;
margin-left: auto;
background-color: #AEA03A;
float: none;
position: relative;
height: 215px;
}
#footer2 {
width: 100%;
background-color: #AEA03A;
padding-top: 30px;
float: left;
position: relative;
}
#address {
height: 50px;
width: 180px;
background-color: #AEA03A;
float: left;
text-align: left;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
text-decoration: none;
color: #5A6219;
line-height: 1.5em;
}
#contact {
height: 130px;
width: 180px;
background-color: #AEA03A;
float: left;
text-align: left;
margin-right: 180px;
margin-left: 180px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #5A6219;
text-decoration: none;
line-height: 18px;
}
#email {
background-color: #AEA03A;
height: 50px;
width: 180px;
float: right;
text-align: left;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #5A6219;
text-decoration: none;
}
.social {
background-color: #AEA03A;
height: 35px;
width: 100%;
float: right;
margin-top: 20px;
}
#pinterest {
height: 20px;
width: 20px;
float: left;
background-repeat: no-repeat;
margin-left: 15px;
margin-bottom: 15px;
}
.twitter {
height: 20px;
width: 20px;
background-repeat: no-repeat;
float: left;
margin-bottom: 15px;
}
.copywrite {
font-size: 11px;
font-weight: lighter;
text-decoration: none;
font-family: Arial, Helvetica, sans-serif;
text-align: right;
width: 300px;
background-color: #AEA03A;
float: right;
height: 15px;
color: #5A6219;
vertical-align: middle;
margin-bottom: 10px;
margin-top: 5px;
}
.contactlink {
font-family: Arial, Helvetica, sans-serif;
color: #5A6219;
text-decoration: none;
}
.contactlink a {
font-family: Arial, Helvetica, sans-serif;
color: #5A6219;
text-decoration: none;
}
.contactlink:hover {
font-family: Arial, Helvetica, sans-serif;
color: #FFFFFF;
text-decoration: none;
}
h4 {
color: #5A6219;
}
.indeximg {
height: 100px;
width: 900px;
background-repeat: no-repeat;
background-position: center top;
background-image: url(../olivaimages/indeximg.png)
}
.indexwrap {
height: 100%;
width: 810px;
padding-left: 90px;
}
#wrapper {
min-height: 100%;
}
.clearfooter {
height: 215px;
clear: both;
}
try this
#footerframe {
background-color: #AEA03A;
bottom: 0;
float: right;
height: 223px;
position: absolute;
width: 100%;
}
Replacing the footers 900px with 100% should do the trick.
I think you'll need implement a sticky footer technics by setting html,body height to 100% and
setting id#container as the following:
html, body {
margin: 0;
padding: 0;
height: 100%;
}
#container {
height: auto !important;
min-height: 100%;
height: 100%;
}
example