简体   繁体   中英

How do I align this border?

This is what I have so far: http://jsfiddle.net/u8GHJ/

What I'm trying to do is attach the black border to the left side of the blue box. What is an easy way to achieve this? And no, I can't just add border-left:4px solid black; to #container li .

It should look like this: http://i.stack.imgur.com/oLBK8.png

Edit: I need to move the border to the container and not the opposite, so setting the padding to 0 won't help in this case.

There's default padding on the ul element. To remove it, add ul {padding:0;} ( or #container {padding:0;} ) to your css and every thing will look peachy.

Check out your updated example here:

http://jsfiddle.net/agconti/u8GHJ/1/

ul have default padding Give this a try to resolve your problem:

#container{
    padding:0;
}

JS Fiddle

I have solved your problem. Just add css property of ul

ul{
    padding:0px;
  }

Click here for DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM