I built a little visual overview of lessons that I want to integrate into a wordpress template. So I started out simply building the thing first and got the result that I was looking for and looks like this: Menu example
Now I wanted to integrate in my WordPress template but as soon as I add a link around the list elements it completely falls apart: Overview fallen apart in theme
If however I remove the link tags it stays in shape: –> Click on “Scrum lernen” on the page above to see the example where it stays in shape without the links. I can only post two links at the moment due to lack of reputation.
I have played around for hours today in the CSS and tried all sorts of things mainly trying to get rid of any formatting that may be dictated by the template on links. However, I couldn’t get it working at all.
So, in my original from the very first link above this is the core:
HTML:
<div class="lernLesson">
<ul>
<a href=""><li>Geschichte von Scrum <img src="checkmark.png"/></li></a>
<a href=""><li>Das Scrum-Gerüst <span>open</span></li></a>
<a href=""><li>Die Scrum-Rollen <span>open</span> </li></a>
<a href=""><li>Der Scrum Fluss <span>open</span> </li></a>
<a href=""><li id="LessonEnd">Die Scrum Artefakte <img src="checkmark.png"/> </li></a>
</ul>
</div>
According CSS:
.lernLesson ul a li {
margin-bottom: 2px;
background-color: #FAF4CD;
height: 35px;
padding: 10px 0 0 10px;
font-family: "Helvetica Neue", Arial, sans-serif;
font-size: 12px;
text-decoration: none;
}
.lernLesson ul li:hover {
background-color: #F5C253;
text-decoration: none;
font-weight: 900;
}
#LessonEnd {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
So the question is what else I can try in order to prevent the overview from falling apart as soon as I link the list elements?
Sorry for the potentially bad code. I only starting coding HTML and CSS two weeks ago^^.
Edit: Take off the li padding and add display: block to the link.
CSS:
A child of a UL should always be an LI
This is correct markup
Once you have done this you can display the links ans blocks
You may need to set the width and height depending on the rest of your css.