Got a link that got a span, inside that span I will from jquery add a number of news. But I want it to be smaller and with a bit of padding so it looks like a notification on a app?
This is the code I got:
<a id="menyNavOptions" href="nyheter.php" >Nyheter<span style="margin-bottom: 30px; font-size: 0.8em;font-weight:bolder ; color: #ff0000!important; line-height:0.3em;" id="outPost"></span></a>
So the look I am going for is a Link with a number on the top right corner
Thanks
Got a link that got a span, inside that span I will from jquery add a number of news. But I want it to be smaller and with a bit of padding so it looks like a notification on a app?
This is the code I got:
<a id="menyNavOptions" href="nyheter.php" >Nyheter<span style="margin-bottom: 30px; font-size: 0.8em;font-weight:bolder ; color: #ff0000!important; line-height:0.3em;" id="outPost"></span></a>
So the look I am going for is a Link with a number on the top right corner
Thanks
Share Improve this question asked Dec 2, 2013 at 18:32 Christoffer JacobsenChristoffer Jacobsen 1,2513 gold badges14 silver badges14 bronze badges 1- can you explain more it looks like a notification on a app with an image or something else – DaniP Commented Dec 2, 2013 at 18:41
3 Answers
Reset to default 3display:block
won't help, because it will have the full width (100%). Use display:inline-block;
http://jsfiddle/M5TKv/
But I'm not sure if Padding bottom will do what you want.
I think you want to do this:
http://jsfiddle/M5TKv/1/
Try add display:inline-block in the CSS and it should behave as you expect :)
But I would rather use position relative on the link and position absolute on the span.
.linkclass {
position: relative;
}
.spanclass {
position: absolute;
top: -10px;
right: 0;
}
Add display: inline-block; float: right;