Home >Web Front-end >HTML Tutorial >Newbies need help with the problem of adding background images_html/css_WEB-ITnose
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><link rel="stylesheet" href="css/harmonise.css" type="text/css" /><link rel="stylesheet" href="css/base-groups.css" type="text/css" /><link rel="stylesheet" type="text/css" href="css/ie.css" /><title>简单的圆角矩形</title></head><style type="text/css">h2 { color: #94b767;}.box { width: 418px; background: none; padding-bottom: 0px; }.box h2 { background: none; margin-top: 0; padding: 20px 20px 0 20px;}.box p { padding: 0 20px;} </style></head><body><h1>简单的圆角矩形</h1><div class="box"> <h2>圆角矩形</h2> <p>圆角矩形的应用是时尚网站的标志!</p></div></body></html>
Add a relative attribute to the box, put the rounded corners into the div, make them absolute, and then adjust the coordinates yourself