Below is my HTML code
<UL>
<LI>
<LI>
..
<LI>
<a class="upload_menu" href="someLink" ><span>Your Recipes</span></a>
</LI>
<LI>
</UL>
Below is the CSS class
.ie7 #navigation .upload_menu {
background-color: #bb3f3f;
color: #FFF;
float: left;
font-size: 12px;
font-weight: bold;
padding: 9px 4px 10px 6px;
text-decoration: none;
!background: url(../../../static-files/images/common/nav-divider.gif) no-repeat right;
border-right: 1px solid #BCDAEE;
}
.ie7 #navigation .upload_menu:hover {
background-color: #bb3f3f;
}
Also gave a try for below CSS
*:first-child +html #navigation .upload_menu {
background-color: #bb3f3f;
color: #FFF;
float: left;
font-size: 12px;
font-weight: bold;
padding: 9px 4px 10px 6px;
text-decoration: none;
!background: url(../../../static-files/images/common/nav-divider.gif) no-repeat right;
border-right: 1px solid #BCDAEE;
}
*:first-child +html #navigation .upload_menu:hover {
background-color: #bb3f3f;
}
But background-color attrtibute itself is not being taken as can be seen in Developer tool.
I think the problem here is the hacky:
!background: url(../../../static-files/images/common/nav-divider.gif) no-repeat right;
It appears to be overriding your background-color attribute (going by the background-image property in the "Current Style" list) - unless you're giving it a background-image elsewhere - if so that code hasn't been provided.
What you can do is add the colour to that declaration:
!background:#bb3f3f url(../../../static-files/images/common/nav-divider.gif) no-repeat right;
Or alternatively separate those background parts out a little to prevent it overriding the background-color attribute:
!background-image:url(../../../static-files/images/common/nav-divider.gif);
!background-repeat:no-repeat;
!background-position-x:right;
Related
How do I add an underline for an active or hovered link, where the underline shows up at the bottom of the menu bar it's a part of? With the code I currently I have (see below) the underline is showing up directly UNDERNEATH the menu bar, rather than showing up at the bottom of the menu bar. I tried using negative padding/margin, but that didn't work. Right now I have this:
.horiz-tab, .horiz-tab-active {
background: #actionBar;
float: left;
font-size: 1.2rem;
padding: 1.5rem 1.125rem;
position: relative;
}
a.horiz-tab:link, a.horiz-tab:visited {
color: #fff;
text-decoration: none;
text-transform: uppercase;
}
a.horiz-tab:hover {
color: #fff;
text-decoration: none;
border-bottom: #4c7296 6px solid;
overflow: none;
bottom: 0px;
}
.tab-count {
background-color: #689dcd;
border-radius: 15px;
color: #fff;
font-size: .9rem;
margin-left: 0.35rem;
padding: 2px 6px;
}
The HTML looks like this:
<div *ngFor="let record of records; let i = index;">
<a routerLink="/organization" routerLinkActive="horiz-tab-active" class="horiz-tab">{{record._id.sub}}<span class="tab-count">{{record.count}}</span></a>
</div>
The OP has .main as a class in CSS yet there is none in HTML
.horiz-menu {
color: #fff;
background: #000;
height: 34px;
padding:6px 0 0 3px;
}
a.horiz-menu-tab:hover {
color: #fff;
background: #000;
display: block;
text-decoration: none;
border-bottom: 6px solid #fb4;
height:28px;
margin:0;
}
<div class="horiz-menu" *ngFor="let record of records">
<a routerLink="/" routerLinkActive="horiz-menu-active" class="horiz-menu-tab">{{info}}</a>
</div>
I'm looking at creating a list of jobs for a careers page side bar.
Each job should consist of the job title and an apply button.
Each listing is encased in a rounded grey box with some margin for spacing.
I've attempted to create it in this pen below, hopefully someone can take a look at my code and advise me on how to get the button floated to the right and the title and button to be centered within the box.
http://codepen.io/adamlcasey/pen/jIsFB
I'm fairly new to css and html, so I'm not at the point where I know what the best way to implement this is? In the pen above I've used two different options.
The first uses a div, h4 and elements
The second uses a div and unordered list.
NOTE:The final code needs to be placed inside of a template for my CMS (Hubspot). Hubspot have some rules about template design that I can't use. (So that their templates stay responsive) one of which is the element.
Here's my code:
<div class="box">
<h4>Business Development <br>
Manager</h4>
<a class="button" href="http://www.my-site.com/business-development- manager">Apply</a>
</div>
<div class="box">
<ul>
<li><h4>Customer Support <br>Agent</h4></li>
<li><a class="button" href="http://www.my-site.com/business-development-manager">Apply</a></li>
</ul>
</div>
CSS Code:
p, h4, a, li {
font-family: 'Open Sans',sans-serif!important;
}
.box {
background: #f2f2f2;
border-radius: 4px;
padding: 1em 1em;
margin: 2em 0!important;
text-align: left;
}
h4, li {
font-weight: 300;
color: #07355C;
display: inline-block;
vertical-align: middle;
}
.button {
font-size: 1em!important;
padding: 5px 20px!important;
text-decoration: none;
-webkit-box-shadow: #e28b00 0 1px 0;
-moz-box-shadow: #e28b00 0 1px 0;
box-shadow: #e28b00 0 1px 0;
background-color: #f6ae2b;
background-image: -webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#f6ae2b),color- stop(70%,#f39d13));
background-image: -webkit-linear-gradient(#f6ae2b,#f39d13 70%);
background-image: -moz-linear-gradient(#f6ae2b,#f39d13 70%);
background-image: -o-linear-gradient(#f6ae2b,#f39d13 70%);
background-image: linear-grad;
padding-left: 0;
padding-right: 0;
text-align: center;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
padding: 10px 20px;
font-size: 18px;
border: none;
color: white;
display: inline-block;
vertical-align: middle;
float: right;
margin-right:1em;
}
.box ul {
margin: 0;
padding: 0;
list-style-type: none;
}
Here is another Idea. I do not provive code in my answer because it is too much. Mainly i just added some grid like wrappers
http://codepen.io/Nico_O/pen/ybjLE
I've been working on a css menu and it works fine in every browser besides Internet Explorer.
The issue can bee seen below: The first <li> element is not properly aligned. In fact, it's pushed down.
#sub-navigation {
background: url("{T_THEME_PATH}/images/subnavigation.png") repeat-x;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
height: 25px;
line-height: 25px;
border-bottom: 1px solid #dfeaf1;
border-left: 1px solid #dfeaf1;
border-right: 1px solid #dfeaf1;
border-top: 3px solid #ffffff;
}
#second-navigation li {
border-right: 1px solid #cddfeb;
padding-right: 14px;
padding-left: 14px;
margin-left: 0px;
float: left;
display: block;
font-size: 11px;
font-weight: none;
font-color: #6b6b6b;
}
#second-navigation ul {
position: absolute;
display: none;
z-index: 999;
background: #4e4e4e;
border: none;
border-radius: 2px;
width: 80px;
color: #FFFFFF;
}
<div id="sub-navigation">
<ul id="second-navigation" class="leftside">
<li>
<center>Calendar</center>
</li>
<li>
HH Converter
</li>
<li>
Poker Bonuses
</li>
</div>
Anyone know how to fix this, so it works in Internet Explorer.
Unfortunately, I can't test the actual code for you at the moment. Test stations are being moved around. From experience and off the top of my head -- there are a few errors.
The code:
#sub-navigation {
background: url("{T_THEME_PATH}/images/subnavigation.png") repeat-x;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
height: 25px;
line-height: 25px;
border-bottom: 1px solid #dfeaf1;
border-left: 1px solid #dfeaf1;
border-right: 1px solid #dfeaf1;
border-top: 3px solid #ffffff;
}
#second-navigation ul {
position: absolute;
display: none;
z-index: 999;
background: #4e4e4e;
border: none;
border-radius: 2px;
width: 80px;
color: #FFFFFF;
list-style:none;
}
#second-navigation li {
border-right: 1px solid #cddfeb;
padding-right: 14px;
padding-left: 14px;
margin-left: 0px;
float: left;
display: inline-block;
font-size: 11px;
font-weight: none;
font-color: #6b6b6b;
list-style-type:none;
}
#second-navigation li a {
display:block;
}
#second-navigation .center {
text-align:center;
}
<div id="sub-navigation">
<ul id="second-navigation" class="leftside">
<li>
Calendar
</li>
<li>
HH Converter
</li>
<li>
Poker Bonuses
</li>
</ul>
</div>
The changes are:
Unless you have a reset somewhere (like YUI Reset) ul and li should
include a list-style: none; and list-style-type:none;
On Internet Explorer, float:left; should be accompanied by
display:inline-block; NOT display:block;
On most browsers, elements within a p and a tag, will work... IE
usually throws a hissy fit. Use CSS to declare a text-align center...
which you should be doing anyways.
Hopefully this will help!
On a side note, CSS wise... if you are wanting the links centered and what not -- get rid of all the padding & margin write ups... browsers consider padding & margins differently and could be causing the issue.
A simple:
a {
display:block;
line-height: 25px;
text-align:center;
}
Would do the trick.
I'm trying to create an active state for a div.
Got the hover working but when i'm on the page in question the active won't show.
What i'm trying to implement is the same style as the hover.
Here's the css for the div.
#fp-design a { width: 240px; height: 47px; float: left; display: block; background:url(images/assets/break.jpg) no-repeat; background-position: top right; }
#fp-design a:hover { height: 44px; border-bottom: 3px solid #d3028e; text-decoration:none; }
#fp-design a:active { height: 44px; border-bottom: 3px solid #d3028e; text-decoration:none; }
#fp-design h2 { height: 20px; font-size: 16px; font-weight: bold; margin: 0; padding: 4px 0 0 12px; text-align: left; color: #FFF; text-decoration:none; }
#fp-design h3 { height: 11px; font-size: 10px; font-weight: bold; margin: 0; padding: 0 0 0 12px; text-align: left; color: #FFF; text-decoration:none; }
Here's the page code
<div id="fp-design">
<a href="<?php bloginfo('url'); ?>/web-design/"><h2>WEB DESIGN</h2>
<h3>PROFESSIONAL WEBSITE DESIGN</h3></a>
</div>
TIA
a:active means "is being clicked". Not "is loaded". is that what you are after?
It somewhat reads as if you want the div to change appearance if a page is being viewed. in order to do that you'll need to add a class to the div, the hover/active states won't do it. a:link = link sitting on a page, a:visited = a link that has been clicked previously, a:hover = a link when the mouse is over it, a:active = a link when the mouse clicks on it.
Any lists that I make with the following CSS appear differently in IE8 and FF4. IE8 doesn't have rounded corners, but FF4 doesn't change colour when I hover over it. Are either of them right?
ul#mend {
border-bottom: 1px #5C87B2 solid;
padding: 0 0 2px;
position: relative;
margin: 0;
float: left;
text-align: left;
}
ul#mend li {
display: inline;
list-style: none;
}
ul#mend li#greeting {
padding: 10px 20px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
color: #fff;
}
ul#mend li a {
padding: 10px 20px;
font-weight: bold;
text-decoration: none;
line-height: 2.8em;
background-color: #FF99CC;
color: #034af3;
border-radius: 4px 4px 0 0;
-webkit-border-radius: 4px 4px 0 0;
-moz-border-radius: 4px 4px 0 0;
}
ul#mend li a:hover {
background-color: #000000;
text-decoration: none;
}
ul#mend li a:active {
background-color: #a6e2a6;
text-decoration: none;
}
ul#mend li.selected a {
background-color: #fff;
color: #000;
}
Edit: Added HTML
<div id="menucontainer">
<ul id="mend">
<li>#Html.ActionLink("TicTacToe", "TicTacToe", "Games")</li>
</ul>
<ul id="menu">
<li>#Html.ActionLink("Home", "Index", "Home")</li>
<li>#Html.ActionLink("About", "About", "Home")</li>
<li>#Html.ActionLink("French", "French", "Home")</li>
</ul>
</div>
Internet Explorer doesn't support rounded corners natively. You need to use a hack to get that done.
IE 9 now supports rounded corners. I'm partial to this solution for previous versions of IE:
CSS3 Pie
I might be missing something but the second list you have included (id="menu") doesn't have any corresponding CSS in your example.
Backing up what the others have said IE8 doesn't support border-radius.