首页
极刻
圈子
教程
开源
极客社区
写文章
发极刻
建圈子
发项目
登录 / 注册
返回教程:CSS 教程
TRY RUN / 在线示例
CSS 教程 使用百分比来设置元素的最大宽度
CSS 教程 使用百分比来设置元素的最大宽度
源代码
运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>安科教程(www.ancii.com)</title> <style> p { max-width:20%; background-color:yellow; } </style> </head> <body> <p>This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p> </body> </html>
运行结果