Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Layout Basics CSS Layout Project Creating and Styling the Layout Containers

Juan David Hernandez
Juan David Hernandez
7,415 Points

where do I put the padding to be touch screen?

Let's gonna imagine I have a simple bar menu.

<div>

<ul class ="main-nav">
   <li><a herf =#Home> Home </a></li>
   <li><a herf =#about> about </a></li>
   <li><a herf =#Contact> Contact </a></li>
 </ul>

</div>


my question is where I have to put the padding if I want the screen touch?

target the tag element inside the "li" and add padding someting like

li a{

padding: 15px;

}

or add padding to li something like:

main-nav li { padding: 15px; }

2 Answers

Juan David Hernandez
Juan David Hernandez
7,415 Points

In the challenge I did but I put the padding in the tag element and it works!

Stephen Fowles-White
Stephen Fowles-White
10,457 Points

I think what you are asking and apologies if I'm wrong but its just to clarify my response. Where do you put the padding to make the hyper links / nave menu bigger and wider so they are easier to click on.

To do this I think you need to target the <a> tag inside the <li> tag. This can be done in the above way you put

ul li a{padding: 15px};

or to increase specify (if you have more than one unordered list in the future)

main-nav li a { padding: 15px };

By doing this it increase the size of the <a>'s link size on the li element which makes the target area for touch screen much better for use.

Hope this helps

Stephen

Juan David Hernandez
Juan David Hernandez
7,415 Points

yes, I asked becouse in the video he used the padding in the ul li. Thanks for your answer, I'm learning english also!