How do I prevent the padding property from changing width or height in CSS?

后端 未结 7 1947
面向向阳花
面向向阳花 2020-11-28 17:52

I am creating a site with DIVs. Everything\'s working out except when I create a DIV. I create them like this (example):

newdiv {
    width: 200         


        
7条回答
  •  我在风中等你
    2020-11-28 18:26

    If you would like to indent text within a div without changing the size of the div use the CSS text-indent instead of padding-left.

    .indent {
      text-indent: 1em;
    }
    .border {
      border-style: solid;
    }
    Non indented

    Indented

提交回复
热议问题