Space above text that is next to a image

前端 未结 4 580
轻奢々
轻奢々 2021-01-24 18:05

\"image\"As you can see. I have space above header 3, I want it to be inline with the image itself.

HTML



        
4条回答
  •  一整个雨季
    2021-01-24 18:57

    That's the default stylesheet applied by the user agent. you could reset that by margin: 0; as follows:

    .content h3 {font-size: 22px; margin: 0;} 
    

    Online Demo

    User agents apply some default styles to the HTML elements. For instance they apply a top and bottom margin on the heading elements such as

    .

    As Google Chrome sets -webkit-margin-before: 1em; and -webkit-margin-after: 1em;.

    Most web developers use some CSS declarations at the top of the stylesheet called CSS Reset to reset the user agent default styles.

    Whether to use a tiny reset:

    * { padding:0; margin: 0;}
    

    Or a well-known version by CSS legendary Eric Meyer.

提交回复
热议问题