css3 - border-bottom 的长度可否超过盒子的宽度呢?实现如下图效果。(我的书下面的线)
PHPz
PHPz 2017-04-17 11:42:59
0
7
783

PHPz
PHPz

学习是最好的投资!

reply all(7)
PHPzhong

I set the margin to a negative value and then set the padding to a positive value.

迷茫

What the poster said is to add bordr-bottom to the outer layer of "My Book"

大家讲道理

Logically speaking, it shouldn’t be possible~ because the length of the border itself seems to be the same as the length of the box~ If it is really longer than the box, you can nest a p outside. This is just my personal opinion. If there is anything wrong, please correct me. Thank you.

左手右手慢动作

No, your border-bottom is added inside the box

小葫芦

Set a margin value to a negative value

刘奇

I just tried the 1L and 5L methods and set a negative value for margin, but it didn’t work. In my understanding, the border corresponds to the actual width and height of the block element. The margin attribute can only adjust the position and cannot increase the width and height of the element. So if you want to keep the width of p at 50px, you still want this The border-bottom of p has a length of 100px, which is impossible to achieve, right? I don’t know if my understanding is correct. I’m a css novice. Comments are welcome.
In addition, I think the 2L and 3L methods are possible. I also implemented it this way during the development process. It is currently the simplest and most direct implementation method I know. If there are other better methods, please welcome your guidance!

Ty80

Hey, I read it several times and can’t understand what it means. How can you understand it? What I barely understand means: the width of the horizontal gray line is greater than the width of the horizontal blue line, and it needs to break through the blue line to get out, right? Wouldn't it be nice if the inside box was wider than the outside box? . . Isn’t the border-bottom of the inner box larger than the outer box frame? I feel like I didn’t understand it. . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template