搜索
首页web前端html教程这样的样式怎么实现?_html/css_WEB-ITnose


像这样的样式怎么实现?是从后台动态取出,每个方块都有一个栏目显示,像这样排列


回复讨论(解决方案)

css3还是css2?

见意去看看:CSS3 transform

transform:rotate(90deg);
-ms-transform:rotate(90deg); /* Internet Explorer */
-moz-transform:rotate(90deg); /* Firefox */
-webkit-transform:rotate(90deg); /* Safari 和 Chrome */
-o-transform:rotate(9deg); /* Opera */

css3旋转45度
transform:rotate(45deg);

css3旋转45度
transform:rotate(45deg);


旋转后不要紧凑的排在一起,而是有空白

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:400px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);}div ul li:nth-last-child(4n){margin-left:97px;}</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>
 


css3旋转45度
transform:rotate(45deg);


旋转后不要紧凑的排在一起,而是有空白
要空白用margin调整啊

css3还是css2?



transform:rotate(90deg);
-ms-transform:rotate(90deg); /* Internet Explorer */
-moz-transform:rotate(90deg); /* Firefox */
-webkit-transform:rotate(90deg); /* Safari 和 Chrome */
-o-transform:rotate(9deg); /* Opera */



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:400px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);}div ul li:nth-last-child(4n){margin-left:97px;}</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>
 


我的是从上到下的排,就是排左边2个,再排右边1个,再排左边2个,这循环怎么搞?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:300px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);}div ul li:nth-child(3n){margin-left:97px;}</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:300px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);}div ul li:nth-child(3n){margin-left:97px;}</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>


大神,不好意思,你没懂我的意思,我的意思从上到下,从左到右的走,像这样:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:300px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);}div ul li:nth-child(3n){margin-left:97px;}</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>


大神,不好意思,你没懂我的意思,我的意思从上到下,从左到右的走,像这样:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:800px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);	margin-left: -45px;	}div ul li:nth-child(1){margin-left:0px;}div ul li:nth-child(3n-1){ margin-left:-125px;margin-top:150px;}div ul li:nth-child(3n){margin-left: -45px;margin-top: 74px; }</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>
亏了,很低的分。。。



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:300px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);}div ul li:nth-child(3n){margin-left:97px;}</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>


大神,不好意思,你没懂我的意思,我的意思从上到下,从左到右的走,像这样:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css">div{ background:#62aff3; width:800px; height:400px; padding:30px;}div ul{list-style:none;margin:0;padding:0}div ul li{float:left; width:100px; height:100px; border:2px solid #7bcbff; margin:0 22px; border-radius:10px; 	transform: rotate(45deg);	-ms-transform: rotate(45deg);		/* IE 9 */	-webkit-transform: rotate(45deg);	/* Safari and Chrome */	-o-transform: rotate(45deg);		/* Opera */	-moz-transform: rotate(45deg);		/* Firefox */	background:#004594;	background-image:-webkit-linear-gradient(to top right, #004594, #0186fc,#025cb2);	background-image:linear-gradient(to bottom right, #004594, #0186fc,#025cb2);	margin-left: -45px;	}div ul li:nth-child(1){margin-left:0px;}div ul li:nth-child(3n-1){ margin-left:-125px;margin-top:150px;}div ul li:nth-child(3n){margin-left: -45px;margin-top: 74px; }</style></head><body><div>	<ul>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    	<li></li>    </ul></div></body></html>
亏了,很低的分。。。
不亏,都给你吧
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
HTML标签和HTML属性有什么区别?HTML标签和HTML属性有什么区别?May 14, 2025 am 12:01 AM

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

HTML的未来:进化和趋势HTML的未来:进化和趋势May 13, 2025 am 12:01 AM

HTML的未来将朝着更加语义化、功能化和模块化的方向发展。1)语义化将使标签更明确地描述内容,提升SEO和无障碍访问。2)功能化将引入新元素和属性,满足用户需求。3)模块化将支持组件化开发,提高代码复用性。

为什么HTML属性对Web开发很重要?为什么HTML属性对Web开发很重要?May 12, 2025 am 12:01 AM

htmlattributesarecrucialinwebdevelopment forcontrollingBehavior,外观和功能

Alt属性的目的是什么?为什么重要?Alt属性的目的是什么?为什么重要?May 11, 2025 am 12:01 AM

alt属性是HTML中标签的重要部分,用于提供图片的替代文本。1.当图片无法加载时,alt属性中的文本会显示,提升用户体验。2.屏幕阅读器使用alt属性帮助视障用户理解图片内容。3.搜索引擎索引alt属性中的文本,提高网页的SEO排名。

HTML,CSS和JavaScript:示例和实际应用HTML,CSS和JavaScript:示例和实际应用May 09, 2025 am 12:01 AM

HTML、CSS和JavaScript在网页开发中的作用分别是:1.HTML用于构建网页结构;2.CSS用于美化网页外观;3.JavaScript用于实现动态交互。通过标签、样式和脚本,这三者共同构筑了现代网页的核心功能。

如何在标签上设置lang属性?为什么这很重要?如何在标签上设置lang属性?为什么这很重要?May 08, 2025 am 12:03 AM

设置标签的lang属性是优化网页可访问性和SEO的关键步骤。1)在标签中设置lang属性,如。2)在多语言内容中,为不同语言部分设置lang属性,如。3)使用符合ISO639-1标准的语言代码,如"en"、"fr"、"zh"等。正确设置lang属性可以提高网页的可访问性和搜索引擎排名。

HTML属性的目的是什么?HTML属性的目的是什么?May 07, 2025 am 12:01 AM

htmlattributeseresene forenhancingwebelements'functionalityandAppearance.TheyAdDinformationTodeFineBehavior,外观和互动,使网站互动,响应式,visalalyAppealing.AttributesLikutesLikeSlikEslikesrc,href,href,href,类,类型,类型,和dissabledtransfransformformformformformformformformformformformformformformforment

您如何在HTML中创建列表?您如何在HTML中创建列表?May 06, 2025 am 12:01 AM

toCreateAlistinHtml,useforforunordedlistsandfororderedlists:1)forunorderedlists,wrapitemsinanduseforeachItem,RenderingeringAsabulleTedList.2)fororderedlists,useandfornumberedlists,useandfornumberedlists,casundfornumberedlists,customeizableWithTheTtheTthetTheTeTeptTributeFordTributeForderForderForderFerentNumberingSnumberingStyls。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

MinGW - 适用于 Windows 的极简 GNU

MinGW - 适用于 Windows 的极简 GNU

这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

安全考试浏览器

安全考试浏览器

Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

Dreamweaver Mac版

Dreamweaver Mac版

视觉化网页开发工具

EditPlus 中文破解版

EditPlus 中文破解版

体积小,语法高亮,不支持代码提示功能