I have an interesting layout issue in CSS. My scenario: Imagine a standard paragraph of text with justified alignment. The last word, however, is the authors name, which needs to be aligned to the right border. Depending on the length of text and the width of the paragraph, this could require a longer distance between the last word of the text and the author's name. It could also happen that the paragraph fills the last line completely, and then the author's name should appear one line below, and still aligned to the right.
I have an image here that illustrates this behavior, see the footnotes:
See that in the first footnote the author ("Der Herausgeber") is aligned to the right, but remains in the last line of the text, while in the second footnote the author ("D. H.") jumps one line down, due to text length.
I have tried to emulate this with the following HTML/CSS:
p {
width: 350px;
text-align: justify;
}
span.author {
display:inline-block;
text-align:right;
max-width:100%;
font-style: italic;
white-space: nowrap;
}
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. <span class="author">The Author</span></p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor massa. <span class="author">The Author</span></p>
So far, the author comes as a separate element, and it jumps to the next line as a separate unit (no wraps allowed). But I have problems aligning it to the right border. I have tried min-width and max-width, which did not work. I have also tried to approach this with flexbox, but until now I did not come even close to a solution. Maybe the HTML code needs to be modified as well. Is there any hint you could give me?
You can try something like this using float:right
p {
width: 350px;
text-align: justify;
}
span.author {
display:inline-block;
text-align:right;
font-style: italic;
white-space: nowrap;
float: right;
}
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. <span class="author">The Author</span></p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor massa. <span class="author">The Author</span></p>
just set float: right; to author span tag
p {
width: 350px;
text-align: justify;
}
span.author {
display:inline-block;
text-align:right;
max-width:100%;
font-style: italic;
white-space: nowrap;
float: right;
}
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. <span class="author">The Author</span></p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor massa. <span class="author">The Author</span></p>
You want something like this? I separated the .author from the p
p {
clear: both;
width: 350px;
text-align: justify;
margin-bottom: 0;
}
.author {
display: inline-block;
float: right;
max-width: 100%;
font-style: italic;
white-space: nowrap;
}
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. </p><span class="author">The Author</span>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor massa. </p><span class="author">The Author</span>
Related
Right now the text is like this:
Lorem ipsum dolor sit amet consectetur adipiscing
elit vitae orci elementum dictum
I want to be like that:
Lorem ipsum dolor sit amet consectetur adipiscing
elit vitae orci elementum dictum
I want the second text line to start where the first line starts.
the first text line is aligned to right.
try this out. May be helpful
<p>Lorem ipsum dolor sit amet consectetur adipiscing<br>
<span>elit vitae orci elementum dictum</span></p>
<style>
p { float: right; }
span { float: left; }
</style>
Another simple way of doing it is using 2 p tags
In HTML:
<p class="text">Lorem ipsum lorem ipsum</p>
<p class="author">Author</p>
In Css:
.text{
font-size: 15px;
}
.author{
font-size: 12px;
color: grey;
}
I have an item list which is coming dynamically from the database so I don't have any idea about the content. I have to display the four li in a single row with equal height. I tried below code but it's not working.
I tried display:flex to the ul but all the li tags are displaying in one line. I also try display: table and display: table-cell; but the same issue all are displaying in one line.
body {
margin: 0;
padding: 0;
}
.List {
max-width: 1140px;
margin: auto;
}
.List ul {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
}
.List ul li {
width: 24%;
padding: 20px;
box-shadow: 1px 1px 12px 0px #EBE8E8;
border-radius: 03px;
background-color: #fff;
margin: auto 07px 14px auto;
display: inline-block;
}
<div class="List">
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean </li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean </li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
</li>
</ul>
</div>
My expected output is
1 2 3 4
5 6
try this:
body {
margin: 0;
padding: 0;
}
.List {
max-width: 1140px;
margin: auto;
}
.List ul {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.List ul li {
padding: 20px;
box-shadow: 1px 1px 12px 0px #EBE8E8;
border-radius: 03px;
background-color: #fff;
margin: 0 10px;
flex: 1 0 19%;
max-width: 19%;
}
codepen
Your code is almost right but needs some enhancement...You have to remove add display flex property on ul and flex warp property also...flex wrap automatically break the element according to view port..And there is no need to add margin in li..
CSS:
.List ul {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
}
.List ul li {
width: 20%;
padding: 20px;
box-shadow: 1px 1px 12px 0px #EBE8E8;
border-radius: 03px;
background-color: #fff;
margin-bottom: 20px;
}
I've put together a sample for you, let's check it out:
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
}
.List {
max-width: 1140px;
margin: auto;
}
.List ul {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
display: flex;
flex-flow: row wrap;
}
.List ul li {
flex: 0 0 auto;
width: 25%;
padding: 20px;
box-shadow: 1px 1px 12px 0px #EBE8E8;
border-radius: 3px;
background-color: #fff;
}
<div class="List">
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean </li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean </li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
</li>
</ul>
</div>
Let's break it down a bit so you can understand it more clearly.
First, we reset the box-sizing property with this:
* {
box-sizing: border-box;
}
This ensures that the column width won't be affected by border-width and padding properties, which you are using with padding: 20px;
By default, using display: flex will make its direct children equal height, by removing margin CSS margin: auto 0.5% 1% auto; will resolve the issue. The issue with your margin CSS is auto value will align the flex item to vertically center, no wonder you don't get equal height.
Let me know if you need some more help,
Since you know that you want only 4 columns in a row, set the width of each li element to 25%. But considering that you're applying padding and margins as well, reduce the width of the lis by the amount of padding and margin you're giving.
Also, try to be consistent in using units of values, such as %, px, em, etc. Mixing and matching these in the same element can give unexpected results.
So here, setting the padding to be 1% on each side, and margin to be 0.5% and 1% on the right and left respectively will take up a total of 3.5% of total width for each li. So just set the width to something less than 21.5% and you'll get 4 elements per row.
body {
margin: 0;
padding: 0;
}
.List {
/*max-width: 1140px;*/
margin: auto;
}
.List ul {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
}
.List ul li {
width: 21.5%;
padding: 1%;;
box-shadow: 1px 1px 12px 0px #EBE8E8;
border-radius: 03px;
background-color: #fff;
margin: auto 0.5% 1% auto;
display: inline-block;
}
<div class="List">
<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean </li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean </li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo sociis natoque
</li>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
</li>
</ul>
</div>
You can achieve this by using display: flex; for this you don't need to give minimum height as well. And also layout is easy to manage and make it responsive.
.cstm-row {
display: flex;
flex-wrap: wrap;
list-style: none;
padding-left: 0;
}
.cstm-column {
flex: 1;
}
.orange-column {
background-color: #ffc04d;
}
.blue-column {
background-color: #4d4dff;
}
.green-column {
background-color: #00ffc0;
}
.cstm-row .cstm-column:first-child {
margin-right: 10px;
margin-bottom: 10px;
}
.cstm-row .cstm-column {
margin-right: 10px;
margin-bottom: 10px;
}
.cstm-row .cstm-column:last-child {
margin-right: 0;
margin-bottom: 10px;
}
.cstm-row li {
flex: 1;
padding: 10px;
border-radius: 3px;
}
.cstm-row li:first-child {
margin-right: 10px;
margin-bottom: 10px;
}
.cstm-row li {
margin-right: 10px;
margin-bottom: 10px;
}
.cstm-row li:last-child {
margin-right: 0;
margin-bottom: 10px;
}
<ul class="cstm-row">
<li class="orange-column">
<p>The passage experienced a surge in popularity during the 1960s when Letraset used it on their dry-transfer sheets, and again during the 90s as desktop publishers bundled the text with their software. Today it's seen all around the web; on templates, websites, and stock designs. Use our generator to get your own, or read on for the authoritative history of lorem ipsum.</p>
</li>
<li class="blue-column">
<p>Until recently, the prevailing view assumed lorem ipsum was born as a nonsense text.</p>
</li>
<li class="green-column">
<p>Until recently, the prevailing view assumed lorem ipsum was born as a nonsense text.</p>
</li>
<li class="blue-column">
<p>Until recently, the prevailing view assumed lorem ipsum was born as a nonsense text.</p>
</li>
</ul>
This question already has an answer here:
How to line-through all links inside a border and bold mark certain text of a paragraph
(1 answer)
Closed 3 years ago.
This is the end-product i'm supposed to make and i'm at this-stage.
How do i line-through in css all porttitor>/a> that is in
without affecting .
And how do i bold mark the last paragraph of both borders as shown in the end-product without bold marking everything?
Also if you want you can tell me if i shouldve written everything in a different way.
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="utf-8" />
<title>Uppgift 4E</title>
<style>
html {
background-color: lightslategrey;
}
body {
margin: auto;
width: 500px;
padding-bottom: 0.1px;
/*knep för div margin */
background-color: #f0ffff;
text-align: center;
font-family: sans-serif;
}
h1 {
Color: purple;
}
#billy {
color: darkred;
border-style: solid;
border-color: purple;
border-width: 1.5px;
border-radius: 5px;
text-align: left;
margin: 10px;
}
#bob {
color: darkgreen;
border-style: solid;
border-color: purple;
border-width: 1.5px;
/* border tjockhet */
border-radius: 5px;
/* rundiga kanter på border */
text-align: left;
margin: 10px;
}
p {
margin-left: 5px;
margin-right: 5px;
}
.two {
font-size: large;
}
.three {
font-size: small;
}
#bob>.two>a {
text-decoration: overline underline;
}
</style>
</head>
<body>
<h1>Uppgift 4E</h1>
<div id="billy">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
<p class="two">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
<p class="three">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
</div>
<div id="bob">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
<p class="two">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
<p class="three">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse imperdiet velit sit amet neque tempor et imperdiet augue porttitor.
</p>
</div>
</body>
</html>
Use the <s></s> (strike-through) tag or <del> . The <strike> tag is obsolete is HTML5.
example:
.two a {
text-decoration: line-through;
font-weight: bold;
}
<p>Rachel</p>
<!--Rachel in paragraph tags-->
<p><s>Rachel</s></p>
<!--Rachel in paragraph tags with inner 's' tags-->
<p class="two">I my name is Rachel</p>
<!--line-through css-->
You can also use css
.yourclass a{text-decoration: line-through;}
Regarding bolding text, use font-weight:bold;
Hope this helps
If you can add a class to an HTML element, then you could make a class specifically for bold or line-through, then apply it to what paragraphs that you need to.
Use the text-decoration: line-through; style. It's not obvious what your criterion is for what to affect with this, so I can't suggest a selector.
To mark the last paragraph of each div:
div>p:nth-last-of-type(1) { font-weight: bold; font-size: 110%; }
And you might find fitting the parts together a little easier if you always use:
* { box-sizing: border-box; }
so that container sizes will actually be what a reasonable person would expect them to be.
try this
#bob p:last-child {
font-weight:bold;
}
#bob p:not(.two) a {
text-decoration:line-through;
}
I've been struggling for this a couple of days now. I googled a lot but can't find the right answer. I'm building an website and want to make it full responsive. On my homepage i have 3 blocks of tekst (300 width each). On screens bigger then 1000 pixels they are centered. Until this point i didn't had any issues.
But when the screens become smaller then 1000 pixels i want the blocks to be underneath each other and center to the screen it's been seen from. For an example of my idea visit http://www.t-mobile.nl.If you make your browser smaller the 3 promotion blocks will automatically change to fit your screen.
I also want the blocks to be in formation all the time. Or 3 blocks vertical or 3 blocks horizontal. Not 2 blocks on 1 row and the other on the row below them.
I tried to set the div container to width: 60% but then i get an big space at the left side on a smaller screen. The blocks also don't line up as i would hope.
I made an JSFiddle of the part i already have. You can visit it here: https://jsfiddle.net/gertjan2805/vj0grfpy/
Does anyone know how to fix this? It would be a great help :)
This is my HTML:
<div class="container">
<div class="containersmall">
<div class="top">DIV Test</div>
<div class="text">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.</div>
</div>
<div class="containersmall">
<div class="top">DIV Test</div>
<div class="text">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.</div>
</div>
<div class="containersmall">
<div class="top">DIV Test</div>
<div class="text">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.</div>
</div></div>
body {
background-color: #EDEDED;
font-family: 'Verdana';
margin-left: 0px;
margin-top: 20px;
margin-right: 0px;
}
.container {
width: 1005px; /*1005px or 59%*/
margin: auto;
position: relative;
text-align:center;
}
.containersmall {
width: 310px;
float: left;
margin-left: 25px;
}
.top {
width: 310px;
background-color: #67B3BD;
text-align: center;
font-size: 22px;
color: #FFFFFF;
height: 50px;
-moz-box-shadow: 0 0 5px #888;
-webkit-box-shadow: 0 0 5px#888;
box-shadow: 0 0 5px #888;
margin: auto;
padding-top: 20px;
float: left;
}
.text {
width: 300px;
text-align: justify;
-moz-box-shadow: 0 0 5px #888;
-webkit-box-shadow: 0 0 5px #888;
box-shadow: 0 0 5px #888;
margin: auto;
padding: 5px;
background-color: #FFFFFF;
float: left;
}
There are two ways: media queries or flexbox.
For media queries, something like this may suffice (not tested):
#media (max-width : 1000px){
.containersmall {
clear:both;
width:100%;
}
}
For flexbox, I'm going to refer you to a tutorial: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Hope this helps,
Chris
What you need are media queries - for anything below 1000px (inclusive), you will want to set width container boxes at 100%, something like:
#media only screen and (max-width: 1000px) {
.container {
width: 100%;
}
.containersmall {
width: 100%;
}
.top {
width: 100%;
}
etc...
}
So you should have no fixed values for any element within box.
I'm having a big trouble... i cant make a div grow with content...
i've got this HTML to fix it here... but i cant do that... can someone help me with this...??
I Uploaded the link here: http://efdutra.com/help
The div that i need to grow, well.. you will see the Lorem Ipsum getting over the footer... :p
There is some part of the html:
<div id="boxes">
<div id="boxFinal">
<div id="linksBoxFinal">
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed massa felis, accumsan eget mattis sed</li>
</ul>
</div>
<img id="barraFinal" src="img/barraBoxFinal.png" />
</div>
</div>
And here the css:
#boxes{
margin:0;
padding:0;
position:relative;
float:left;
height: 100%;
width: 100%;
overflow: none;
}
#boxFinal{
margin:15px 0 0 8px;
padding:0;
float:left;
position:relative;
width:100%;
max-height:100%;
overflow:inherit;
}
Can someone please help me...?
Having played around with your styles I see a lot of things wrong. Firstly you do not need to float everything left. next you need to add lis to around you anchor tags in the ul. third you need to remove the absolute positioning of #lineBoxFinal. If you use the following styles (replacing your existing ones) then the footer should work properly
//line 241
#linksBoxFinal ul {
margin: 5px 0 35px 15px;
z-index: 3;
}
//line 262
#barraFinal {
position: relative;
margin: 0 110px;
z-index: 2;
clear: both;
}
Thats because position:absolute on div[.linksBoxFinal]>ul
Thats would be in #linksBoxFinal ul on line 241 in your style.css
.
.
try this:
<ul style="position:relative;">
(also, remove the not so needed margin bottom)
as to your question about putting an li inside an anchor, i believe the answer is no. Anchors cannot house block level elements.