DL.DT.DD implements a simple example of left and right layout
this is a question that someone sent an email to ask today. the original idea was to use the ul list to implement it; but there are two troublesome places in this way:
1. if you use ul for layout, the one on the right column is more troublesome;
2. it is troublesome to adapt the borders outside the text;
3. the height may have to be fixed;
so, take a closer look at this layout and think about using dl. dt.dd is reasonable:
1. the layout is more reasonable;
2. it will be easy to expand in the future;
3. there must be very little css;
i tried to write it, it’s okay to take a look! within control!
of course it goes without saying about layout distribution:
<h1 id="标题">标题</h1> <div> <dl> <dt><a href="32">·博客里的文章是我自己写的!</a></dt> <dd>作者:张三</dd> </dl> <dl> <dt><a href="3232">·博客里的文章是我自己写的!</a></dt> <dd>作者:张三</dd> </dl> <dl> <dt><a href="3232">·博客里的文章是我自己写的!</a></dt> <dd>作者:张三</dd> </dl>........... </div>
css part:
<style> *{ margin:0; padding:0;} body{ font-size:12px; line-height:1.8; padding:10px;} dl{clear:both; margin-bottom:5px;float:left;} dt,dd{padding:2px 5px;float:left; border:1px solid #3366ff} dd{ position:absolute; right:5px;} h1{clear:both;font-size:14px;} </style>
look at the effect:
<!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" /> <style> *{ margin:0; padding:0;} body{ font-size:12px; line-height:1.8; padding:10px;} dl{clear:both; margin-bottom:5px;float:left;} dt,dd{padding:2px 5px;float:left; border:1px solid #3366ff} dd{ position:absolute; right:5px;} h1{clear:both;font-size:14px;} </style> </head> <body> <h1 id="test">test</h1> <div> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> </div> <h1 id="test">test</h1> <div> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·我是女生!博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> </div> </body> </html>
what if we say fixed width?
<!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" /> <style> *{ margin:0; padding:0;} body{ font-size:12px; line-height:1.8; padding:10px;} dl{clear:both; margin-bottom:5px;float:left;width:100%} dt,dd{padding:2px 5px;float:left; border:1px solid #3366ff} dd{ float:right} h1{clear:both;font-size:14px;} div{ width:500px; float:left;} </style> </head> <body> <h1 id="标题">标题</h1> <div> <dl> <dt><a href="32">·博客里的文章是我自己写的!</a></dt> <dd>作者:张三</dd> </dl> <dl> <dt><a href="3232">·博客里的文章是我自己写的!</a></dt> <dd>作者:张三</dd> </dl> <dl> <dt><a href="3232">·博客里的文章是我自己写的!</a></dt> <dd>作者:张三</dd> </dl> <dl> <dt><a href="eeqwewq">·博客里的文章是我自己写的!</a></dt> <dd>作者:张三</dd> </dl> <dl> <dt><a href="ewqewq">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="ewqe">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="ewqe">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> </div> <h1 id="标题">标题</h1> <div> <dl> <dt><a href="#">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> <dl> <dt><a href="#">·博客里的文章是我自己写的!</a></dt> <dd>xxx</dd> </dl> </div> </body> </html>
for a related example, i have written one before:
<!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> *{ margin:0; padding:0;} #box{ margin:10px; padding:10px; float:left; border:1px solid #CCC; background:#FFFFCC; font-size:12px; line-height:1.9;} dl{ background:#CCCC00; margin:0; width:120px; text-align:center; float:left; margin:5px;} dt{ background:#CC0033;}dt img{display:block; margin:0 auto;} dd{ background:#FFFF00; } </style> </head> <body> <div id="box"> <dl> <dt> <img src="/static/imghw/default1.png" data-src="http://pics.taobao.com/bao/album/promotion/magicbean_070529.gif" class="lazy" / alt="DL.DT.DD implements a simple example of left and right layout" > </dt> <dd>母亲节-祝福短信</dd> </dl> <dl> <dt> <img src="/static/imghw/default1.png" data-src="http://pics.taobao.com/bao/album/promotion/magicbean_070529.gif" class="lazy" / alt="DL.DT.DD implements a simple example of left and right layout" > </dt> <dd>母亲节-祝福短信</dd> </dl> <dl> <dt> <img src="/static/imghw/default1.png" data-src="http://pics.taobao.com/bao/album/promotion/magicbean_070529.gif" class="lazy" / alt="DL.DT.DD implements a simple example of left and right layout" > </dt> <dd>母亲节-祝福短信</dd> </dl> <dl> <dt> <img src="/static/imghw/default1.png" data-src="http://pics.taobao.com/bao/album/promotion/magicbean_070529.gif" class="lazy" / alt="DL.DT.DD implements a simple example of left and right layout" > </dt> <dd>母亲节-祝福短信</dd> </dl> <dl> <dt> <img src="/static/imghw/default1.png" data-src="http://pics.taobao.com/bao/album/promotion/magicbean_070529.gif" class="lazy" / alt="DL.DT.DD implements a simple example of left and right layout" > </dt> <dd>母亲节-祝福短信</dd> </dl> </div> </body> </html>

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



With the recent climb of Bitcoin’s price over 20k $USD, and to it recently breaking 30k, I thought it’s worth taking a deep dive back into creating Ethereum

It's out! Congrats to the Vue team for getting it done, I know it was a massive effort and a long time coming. All new docs, as well.

I had someone write in with this very legit question. Lea just blogged about how you can get valid CSS properties themselves from the browser. That's like this.

I'd say "website" fits better than "mobile app" but I like this framing from Max Lynch:

The other day, I spotted this particularly lovely bit from Corey Ginnivan’s website where a collection of cards stack on top of one another as you scroll.

If we need to show documentation to the user directly in the WordPress editor, what is the best way to do it?

There are a number of these desktop apps where the goal is showing your site at different dimensions all at the same time. So you can, for example, be writing

I was just chatting with Eric Meyer the other day and I remembered an Eric Meyer story from my formative years. I wrote a blog post about CSS specificity, and
