运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> div { width: 250px; height: 250px; margin: auto; border: solid black 1px; background-image: url('w3css.gif'); background-repeat: no-repeat; background-position-x: center; } </style> </head> <body> <h1>The background-position-x Property</h1> <p>Here, the background image will be positioned in the center of the element on x-axis (in this case, the div element).</p> <div></div> </body> </html>