I am trying to implement a pagination control on the following page:
http://equiniti.hireserve-projects.com/vacancies.html
As you can see when viewed in a decent browser such as Firefox, the pagination controls will appear nicely inline as shown below:
However, when viewed in IE7 and IE8, the pagination controls appear as follows:
By default, these elements should all appear inline so I do not understand why they are overlapping in this way. The following CSS is applied to these elements:
.paginationControls a{
background: none repeat scroll 0 0 #FFFFFF;
font-size: 20px;
margin-left: 3px;
padding: 12px 10px;
color: #424242;
}
.paginationControls a:hover,
span.arrowNext:hover,
span.arrowPrev:hover,
.paginationControls a.jp-current
{
color: #ffffff;
background-color: #E41800;
}
span.arrowNext,
span.arrowPrev{
background: none repeat scroll 0 0 #FFFFFF;
color: #424242;
font-size: 20px;
margin-left: 3px;
padding: 12px 10px;
}
The following is the structure of my HTML:
<div class="pagination">
<span class="arrowPrev">« Previous</span>
<span class="paginationControls"></span>
<span class="arrowNext">Next »</span>
</div>
Could anyone explain why this is happening when spans should appear inline by default? I've tried the usual trick of ensuring that the parent element isn't floated but this doesn't make any difference in this case.
Any help would be greatly appreciated. This is in native IE7 and IE8 on a virtual machine.
I am not able to test IE8 but please try applying:
.pagination span{
display:inline-block
}
As I recall span tags do not render as block level elements by default.
You should also specify a min-height and min-width to force a block.
Alternatively use a div instead of a span tag.
Related
I'm attempting to change the color of a check box? / radio button using CSS, of some code embedded that in our site that is generated by our CMS (the CMS is a 3rd party product integrated into our site):
Looking in FireFox Dev Tools the Check Box / Radio Button element displays this HTML
<div class="SFchk" id="SFusrmanlog" style="" onclick="SF.usr.man('log');" set="1"><div></div><div><strong>Sign In</strong><br>with your email and password.</div></div>
And this CSS:
#SFctr .SFchk[set] > div:first-child {background-color: #f1694f; }
The color from this CSS is red and we want green
I've attempted the following approach, taken to change other elements colors etc, however this has not worked? This CSS was added to our Custom CSS used for our site to manipulate colors and elements etc generated by the CMS.
body #SFctr .SFchk[set] > div:first-child { background-color: #1F7665 !important; }
The check box/ radio button element also has this CSS attached to it in FireFox Dev Tools:
#SFctr .SFchk > div:first-child {
float: left;
margin: 2px 0 0;
padding: 0;
height: 12px;
width: 12px;
border-radius: 12px;
border: 1px solid #777;
}
#SFctr .SFchk > div {
margin: 0 0 0 25px;
padding: 0;
cursor: pointer;
}
Suggestions? - Thanks!
A radio button is a native element so you can't really change the style.
The only way that i know is to use JS.(this article could help you)
Managed to sort this out with this CSS and force the element to be the color I wanted!
#SFctr .SFchk[set]>div:first-child {background-color: #1f7665 !important;}
Removed the body and provided correct formatting, added to global CSS and bingo - issue sorted!
I'm designing a web page and I used HTML5 to make an entire div tag a link. Prior to adding the link, the whole div would expand when I hovered over it. Suddenly, it's only working if I hover over the words, not the box I created. The HTML looks like this (minus the actual link):
<a href="link goes here" style="text-decoration: none;">
<div class="home-tab">
home
</div>
</a>
And the CSS to make it hover looks sort of like this:
.home-tab:hover {
width: 150px;
height: 45px;
margin-top: 30px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
font-family: arial;
color: #FFFFFF;
text-align: center;
font-size: 13pt;
padding-top: 25px;
}
(Note: This is not all of the code in the stylesheet. I have some lovely color in there too.)
Is there something I'm missing in my CSS to make the whole thing work on the hover and not just the words? I'm not even sure what questions to ask to figure out what I've done here.
ETA: I have checked this across three different browsers. It has the same problem on IE, Firefox and Chrome.
ETA: CSS without the :hover attribute.
.home-tab{
width: 150px;
height: 35px;
margin-top: 40px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
font-family: arial;
color: #FFFFFF;
text-align: center;
font-size: 13pt;
padding-top: 25px;
}
ETA: Okay, here's something very weird. It seems that any elements on the far right don't have this problem. Seriously, the forums tab and next button on the far right both have :hover elements and they work exactly as I want them to.
Get rid of the <div> entirely and set <a> to display: block.
You're not supposed to put block-level elements inside of an <a> anyway.
Seems to be working fine here: jsFiddle
The only thing I can think of is that the div is not the size you think it is. the size and width elements that you are setting in your css are only active when your mouse is on the div. You need to set them in the normal non hover settings as well if you want the div to be that size. Right now it is defaulting to just large enough to hold the text. You can see this demonstrated by the black border I added in my example.
Here is my suggestion:
.home-tab {
/*All of the sizing code goes here to create box for div*/
}
.home-tab:hover {
/*anything you want changed on hover goes here*/
}
I hope I was understanding your question correctly. If you need more clarification please let me know. Good luck!
I think you want to expand that div when you hover cursor on that div.
i wrote a code below that will solve your hover problem.
Here is a code for you customize this
.home-tab{
width:150px;
height:45px;
margin-top:30px;
color:#008080;
font-family: arial;
background-color: blue;
transition-duration: .8s;
color:white;
text-align: center;
font-size: 13pt;
padding-top: 25px;
}
.home-tab:hover{
width:200px;
height:60px;
font-size: 16pt;
transition-duration: .8s;
}
a{ text-decoration:none} /* optional*/
</style>
<a href="#"><div class="home-tab">
home
</div>
</a>
In order to make all my links looks like buttons, I've done that in my CSS:
a {
color: #06A;
text-decoration: underline;
margin: 10px 20px;
padding: 10px 20px;
/*background-color: #EEE;*/
border: #BBB solid 1px;
}
They look fine, however, they seem to mix-up, that is they are being positioned as if they had no padding or margins.
Take a look here, if you still don't see my point: http://picasaweb.google.com/lh/photo/1yjC0oyQUbBlo_2D4RqjLZsCgnyUSAKTKup5o2EMfkM?feat=directlink
<a> is by nature and definition an inline element, meaning that it can't be given widths, height, paddings or margins (along with a few other styles).
To change that, simply add display: block; which will turn it into a block level element enabling paddings, margins etc.
If you want something that will stay in the flow but be able to accept these styles, use display: inline-block;. This also applies to other inline elements like <span>.
The easiest solution is to set the line-height correctly (without changing display).
Use "display: block" to make padding and margin have a effect.
Try styling your links with display: inline-block;.
You may want to consider using the float style:
<a style='float:left' href='#' />
...which will let you do all the fun stuff and "help" position your anchors as a bonus.
(If you want things to stop floating, put clear:both )
#snowflake's question-level comment got me thinking.
It might help you to know that there are those who believe that using a list for this sort of content is better than marking up plain anchor tags (after all, this is a list of genres, is it not?).
The code for this would look a bit like this:
HTML:
<ul class="genrelist">
<li>Fantasy</li>
<li>Children's Literature</li>
<li>Speculative Fiction</li>
<li>Absurdist Fiction</li>
<li>Fiction</li>
<li>Word I can't read</li>
</ul>
CSS:
.genrelist {
list-style-type: none;
overflow: hidden;
}
.genrelist li {
/*background-color: #EEE;*/
border: #BBB solid 1px;
display: inline;
float: left;
margin: 10px 20px;
padding: 10px 20px;
}
.genrelist li a {
color: #06A;
text-decoration: underline;
}
The code above would display like this (full-size image):
I am having some trouble with a font size with CSS. Below you see I have .post I have < pre > tags that are nested inside of the post class so should the css I have for the pre tags work below? It is not working but I can't figure out why? The text inside my pre tags end up being 15px instead of 12px
.post {
width: 100%;
clear: both;
padding: 10px 0;
border-bottom: #CBCBCB 1px solid;
background: url(images/post_element.gif) no-repeat 126px 21px;
font-family: arial;
font-size: 15px;
}
.post pre{
font-size: 12px;
}
http://monc.se/kitchen/38/cascading-order-and-inheritance-in-css
.post pre{
font-size: 12px !important;
}
Should work, but to answer your questing we need to view all html + css because it really depends...
In a vacuum, that code should work. However, base tag styling can vary browser-to-browser and <pre> tends to be a bit of an odd one. My first thought is that some other style is overriding it.
Have you used Firebug (or some other developer console) to take a look at the styles being applied and the computed style for the element? That should put you on the right track.
This was a weird issue, I had to end up changing the class and font size for all the other text, everything except the pre tags to get it to finally quit resizing after page load from my JS syntax highlighter
I'd like to use an unordered list for displayign a horizontal navigation. This nav has to be a fixed width.
Markup:
<ul id="page-nav">
<li>RRSP Basics</li>
<li>Contribution Rules</li>
<li>Ways to Fund Your RRSP</li>
<li>Investment Options</li>
</ul>
And the CSS (so far):
#page-nav { width: 423px; height: 57px; margin: 0; padding: 0; }
#page-nav li { list-style: none; float: left; display: block; height: 35px; margin: 13px 8px 0 8px; padding: 9px 14px 0 14px; text-align: center; }
#page-nav li a { color: #1f1f1f; font-size: 10px; white-space: pre-line; }
If firefox, using white-space: pre-line breaks the words as necessary to fit the ul width. This doesn't work in IE6 or IE7, and I need to hit those browsers. In IE, the lis push down to the next line instead of breaking the words in the anchors. is not an option either as this will be content managed at some point.
How can I make the anchors break the words to fit the space available? I can't specify a common width for the list items, so that's not an option.
And how it should look:
Thanks.
Try Listamatic:
Can you take a simple list and use different Cascading Style Sheets to create radically different list options? The Listamatic shows the power of CSS when applied to one simple list.
Pick a list, you should be able to find an unordered list menu there that works.
pre-wrap and pre-line are not supported in IE < 8. So im not sure what an alternative is without resorting to a table :-(
This is untested, but setting a width on your li should do the trick.