|
发表于 2022-3-11 18:13:56
|
显示全部楼层
回帖奖励 +2 鱼币
应该position拼错了
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>用一生来学习艺术</title>
- <style type="text/css">
- body {
- background-image: url('img/bc.jpeg'); /*背景图导入*/
- background-repeat: no-repeat; /*不重复拉伸*/
- background-attachment: fixed; /*此代码用于页面内容超出屏幕,右侧出现滚动条情况,使得滚动滚动条时背景锁定*/
- background-position: center 0; /* 注意,你写错了 */
- }
- h1 {
- text-align: center; /*text-align:文本对齐,水平对齐*/
- color: white; /*color:字体颜色*/
- }
- h2 {
- margin-left: 60%; /*margin-left:左页面空白,左页面余量*/
- color: white;
- }
- p {
- text-indent: 64px; /*text-indent:文本缩进*/
- font-size: 32px; /*font-size:字体大小*/
- line-height: 64px; /*line-height:行高*/
- color: white;
- }
- img {
- position: absolute; /*absolute:绝对定位*/
- left: 50%;
- margin-left: -350px; /*margin-left:左页面空白,左页面余量*/
- }
- </style>
- <style type="text/css" media="print">
- h1 {
- color: black;
- }
- h2 {
- color: black;
- }
- p {
- color: black;
- }
- </style>
- <style
- type="text/css"
- media="screen and (min-width:512px) and (max-width:1024px)"
- >
- body {
- background-image: url(img/bc2.jpg);
- }
- </style>
- </head>
- <body>
- <h1>用一生来学习艺术</h1>
- <h2>王小波</h2>
- <p>我念过文科,也念过理科。</p>
- <p>
- 在课堂上听老师提到艺术这个词,还是理科的老师次数更多:化学老师说,做实验有实验艺术;计算机老师说,编程序有编程艺术。
- </p>
- <p>
- 老师们说,怎么做对是科学,怎么做好则是艺术;前者有判断真伪的法则,后者则没有;
- </p>
- <p>艺术的真谛就是要叫人感到好,甚至是完美无缺;</p>
- <p>
- 传授科学知识就是告诉你这些法则,而艺术的修养是无法传授的,只能够潜移默化。这些都是理科老师教给我的,我觉得比文科老师讲得好。
- </p>
- <img src="img/wxb.jpg" />
- </body>
- </html>
复制代码 |
|