leahsmith97
Coder
Hi all,
This is my first time posting, so I hope I’m doing it correctly.... please bear with me.
I’m very new to coding, so this is probably a super easy question to answer, but it’s driving me nuts.
I have an <ul> nested within another <ul> I need to style the direct children of that FIRST list, but NOT the elements in the second unordered list.
As a part of the exercise I’m doing for my course, we need to place a bottom border under list items 1, 2, 3 but not under the two bullet points in the second . See photo attached for end goal.
I’ve tried everything. Closest I could get was using a child combinator...
This is the CSS I’ve tried:
[CODE lang="css" title="CSS I’ve tried"]ul > li {border-bottom: solid;
border-width: 1px;
border-color: grey}[/CODE]
here is the code in the html (Exercise instructs not to change the html to accomplish what we need to do):
here is the end goal featuring the bottom border under 1, 2, and 3
This is my first time posting, so I hope I’m doing it correctly.... please bear with me.
I’m very new to coding, so this is probably a super easy question to answer, but it’s driving me nuts.
I have an <ul> nested within another <ul> I need to style the direct children of that FIRST list, but NOT the elements in the second unordered list.
As a part of the exercise I’m doing for my course, we need to place a bottom border under list items 1, 2, 3 but not under the two bullet points in the second . See photo attached for end goal.
I’ve tried everything. Closest I could get was using a child combinator...
This is the CSS I’ve tried:
[CODE lang="css" title="CSS I’ve tried"]ul > li {border-bottom: solid;
border-width: 1px;
border-color: grey}[/CODE]
here is the code in the html (Exercise instructs not to change the html to accomplish what we need to do):
HTML:
<ul class="list">
<li>One</li>
<li>Two
<ul>
<li>2.1</li>
<li>2.2</li>
</ul>
</li>
<li>Three</li>
</ul>
here is the end goal featuring the bottom border under 1, 2, and 3