


Today I read the chapter on graphic CSS. Although it mainly talks about the use of the nth-of-type selector, I paid attention to the layout of the page, as follows:
HTML
<body> <p class="article"> <img src="/static/imghwm/default1.png" data-src="http://img.ujian.cc/nice/35.jpg" class="lazy" alt="" /> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> <img src="/static/imghwm/default1.png" data-src="http://img.ujian.cc/nice/36.jpg" class="lazy" alt="" /> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> <img src="/static/imghwm/default1.png" data-src="http://img.ujian.cc/nice/38.jpg" class="lazy" alt="" /> <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> </p> </body>
CSS
<style type="text/css">.article {width: 500px;margin: 20px auto;}.article img:nth-of-type(odd){float: left;margin-right: 10px;}.article img:nth-of-type(even){float: right;margin-left: 10px;}</style>

HTML、CSS和jQuery:制作一个带有浮动效果的按钮,需要具体代码示例引言:如今,网页设计已成为一种艺术形式,通过使用HTML、CSS和JavaScript等技术,我们能够为页面增加各种各样的特效和交互效果。本文将简要介绍如何用HTML、CSS和jQuery制作一个带有浮动效果的按钮,并提供具体的代码示例。一、HTML结构首先,我们需要在HTML文件中

清除浮动有什么方法,需要具体代码示例在网页布局中,浮动是一种常用的布局方法,可以让元素脱离文档流,并相对其他元素进行定位。然而,使用浮动布局时常常会遇到一个问题,就是父元素无法正确地包裹浮动元素,导致页面产生布局错乱的情况。所以,我们需要采取措施来清除浮动,使得父元素能够正确地包裹浮动元素。清除浮动的方法有多种,下面将介绍常用的几种方法,并给出具体的代码示例

HTML布局技巧:如何使用position属性进行浮动元素控制在网页设计中,布局是非常重要的一环。通过合理的布局可以使网页更加美观、易读,提升用户体验。而在实现布局过程中,浮动元素的控制是其中一个关键点。HTML提供了position属性,通过这个属性我们可以实现对浮动元素的控制。本文将介绍如何使用position属性进行浮动元素的布局,并提供一些具体的代码

CSS图像属性指南:outline和displayCSS是前端开发中不可或缺的一部分,其中图像属性也是必不可少的。在这篇文章中,我们将重点介绍两个关于图像属性的重要概念:outline和display。本文将详细说明它们的定义、用法以及具体的代码示例。outline属性概述:outline属性用于在元素周围创建一个轮廓线,不占据布局空间。它是

CSS浮动和清除浮动:掌握浮动和清除浮动的技巧,需要具体代码示例在网页设计和开发中,CSS浮动(float)是常见的布局技术之一。使用浮动可以将元素向左或者向右移动,从而实现元素在页面中的位置调整和排列。然而,浮动元素也会给页面造成一些问题,比如父元素高度塌陷等。因此,掌握浮动的使用和清除浮动的技巧非常重要。本文将重点介绍CSS浮动和清除浮动的技巧,并提供具

CSS布局属性大全:display,position和floatCSS是用于控制网页样式的一种标记语言。在设计网页布局时,布局属性是非常重要的。CSS提供了多种布局属性,其中最常用的是display,position和float。在本篇文章中,我们将详细介绍这三种布局属性,并提供具体代码示例。display属性display属性用于指定元

HTML中无法使用固定定位的问题探讨随着互联网的快速发展,网页设计也变得越来越复杂多样化。在网页设计中,经常需要使用固定定位(position:fixed)来控制元素的位置,使得页面可以实现一些特殊的效果。然而,在一些情况下,HTML中却无法使用固定定位,导致设计师们头疼不已。本文将探讨在HTML中无法使用固定定位的问题,并提供具体的代码示例。一、浮动元素

CSS下拉菜单属性优化技巧:position和z-index在网页设计中,下拉菜单是常见的交互元素之一。通过下拉菜单,用户可以方便地选择所需的选项,提升用户体验。然而,当页面中存在多个下拉菜单时,它们的位置和层叠关系可能会产生问题。为了解决这些问题,我们可以通过使用CSS中的position属性和z-index属性来优化下拉菜单的展示效果。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
