HTML/CSS: One element, 1 pixel high, 100% wide, 0 images, single color, all browsers

I'm looking for a way to do something which in my opinion *should* be super simple, but I couldn't figure it out... I want a graphical element on my web page which is *exactly* 1 pixel high, 100% wide and has a certain color, let's say red. It should look exactly the same in all browser and should preferably not break the semantics too much. I don't want to use any images for this and I don't want to use more than one HTML element. Of course, I will not use JavaScript. I tried the old classic which probably many of you know:
The problem with the above solution is that IE6 will render this as two or three pixels high, to fit the non-existing contents of the `div`. Any ideas?

以上就是HTML/CSS: One element, 1 pixel high, 100% wide, 0 images, single color, all browsers的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » HTML5 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏