A lot of my page’s features (text) include css hover and active.
BUT
They will only work if I first hover over a certain word that seems to trigger the others.
Why is this?
In my case #input1 has an active part that when clicked on the border changes colour.
But this will not work until i hover my cursor over the footer text.
Thanks!
James
Here is the html:
<html>
<head>
<link href="cloud.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="center1"style="margin-top: 300px;">
<form>
<input type="text" class="input1" autofocus="autofocus">
<input type="text" class="input2">
</div>
<div class="footer" style="position:absolute;bottom:0;">
<div class="footer1">
<div id="footer1text">
<a href="aboutus.html " style="text-decoration:none;">About Us</a></div>
<div id="footer1text">Accessibility</div>
<div id="footer1text">Recruiters</div>
<div id="footer1text">Contact Us</div>
</div>
<div class="footer2">
<div id="footer2textcopyright">© 2011 -</div>
<div id="footer2text">Privacy</div>
</div>
</div>
</body>
</html>
css:
body {
margin: 0;
padding: 0;
}
input:focus {
outline: none;
}
.center div {
display:inline-block;
}
.center {
text-align:center;
width:100%px;
margin:0 auto;
}
.center1 div {
display:inline-block;
}
.center1 {
text-align:left;
width:1200px;
text-align:center;
width:100%px;
margin:0 auto;
}
.footer {
background: #FFFFFF;
border-top: 1px solid;
color: #e6e6e6;
height: 30px;
width: 100%;
position:absolute;
float: left;
margin: 0px 0px 0px 0px;
padding:0;
display: table;
}
.footer1 {
background: #FFFFFF;
height: 30px;
width: 350px;
float: left;
margin: 0px 0px 0px 0px;
padding:0;
display:table;
}
#footer1text2 {
font: 13px helvetica;
color: #0040FF;
display: table-cell;
}
.clickhere {
font: 13px helvetica;
color: #0040FF;
text-decoration: underline;
}
#footer1text2:hover {
font: 13px helvetica;
color: #0040FF;
text-decoration: underline;
}
#footer1text {
font: 13px helvetica;
color: #0040FF;
padding: 8px 3px 3px 3px;
display: table-cell;
}
#footer1text:hover {
font: 13px helvetica;
color: #0040FF;
padding: 8px 3px 3px 3px;
text-decoration: underline;
}
.footer2 {
background: #FFFFFF;
height: 30px;
width: 130px;
float: right;
margin: 0px 0px 0px 0px;
padding:0;
display:table;
}
#footer2text {
font: 13px helvetica;
color: #0040FF;
padding: 8px 3px 3px 3px;
display: table-cell;
text-align: right;
}
#footer2text:hover {
font: 13px helvetica;
color: #0040FF;
padding: 8px 3px 3px 3px;
text-decoration: underline;
}
#footer2textcopyright {
font: 13px helvetica;
color: #151515;
padding: 8px 3px 3px 3px;
display: table-cell;
text-align: right;
}
.input1 {
height: 40px;
width: 280px;
background: #FFFFFF;
border: 1px solid #bdbdbd;
border-top: 1px solid #A4A4A4;
font: 21px HelveticaNeue-Light;
color: #151515;
text-align: left;
}
.input1:active {
height: 40px;
width: 280px;
background: #FFFFFF;
border: 1px solid #e6e6e6;
border-top: 1px solid #A4A4A4;
font: 21px HelveticaNeue-Light;
color: #151515;
text-align: left;
}
.input2 {
height: 40px;
width: 280px;
background: #FFFFFF;
border: 1px solid #bdbdbd;
border-top: 1px solid #A4A4A4;
font: 21px HelveticaNeue-Light;
color: #151515;
text-align: left;
}
you are expecting
input1:activeto work like.input1:focusChange:
to:
PS
Fix your code, you need to close that form tag, and should probably do the same with your inputs. Also there should be a space between the style declarations in your code