検索
ホームページウェブフロントエンドCSSチュートリアルCSS多行多列ニュースモード_体験交流

css の複数行および複数列のニュース モード_エクスペリエンス交換

画像を見てください:
CSS多行多列ニュースモード_体験交流

この効果は 3 つでもあります-次元 4 列のニュース モジュールについては、css よりもテーブルの方が便利だと考えてテーブルを使用していましたが、a の float を開発するまでは、ul を使用する方が便利で制御しやすいことがわかりました。まずコードを見てください:

引用:

.news{} 
.news li{ list-style:none; clear:both} 
.news li a#n1{ text-decoration:none; float:left; line-height:22px;} 
.news li a#n2{ text-decoration:none; float:right; color:#999} 
.news li a#n3{ float:right; padding-right:20px;color:#999} 
.news li a#n1:hover{ text-decoration:underline;} 
.news li a#n3:hover,.news li a#n3:hover{ text-decoration:none;}

a#n1 はニュースのタイトルです、左側はフローティング、n2 と n3 はクリック数とリリース日、右側はフロート、距離 20 ピクセルです。
li ではすべてのフロートをクリアする必要があることに注意してください。
テストは ie6、ie7、ff をサポートしています。 、オペラ。

例、3 列: p>

<!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=gb2312" /> 
<title>css多行多列的新闻模式</title> 
<style type="text/css"> 
<!-- 
*{margin: 0px; padding:0px;} 
body { font-family:"宋体"; font-size:12px; color:#000; padding:100px;} 
.news{} 
.news li{ list-style:none; clear:both} 
.news li a#n1{ text-decoration:none; float:left; line-height:22px;} 
.news li a#n2{ text-decoration:none; float:right; color:#999} 
.news li a#n3{ float:right; padding-right:20px;color:#999} 
.news li a#n1:hover{ text-decoration:underline;} 
.news li a#n3:hover,.news li a#n3:hover{ text-decoration:none;} 
/**/ 
--> 
</style></head> 
<body> 
这是三列 
<ul class="news"> 
<li>左列,新闻标题项点 击发布日期</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线88882008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线88882008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线88882008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线88882008-08-08</li> 
</ul> 
</body> 
</html>

例、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=gb2312" /> 
<title>css多行多列的新闻模式</title> 
<style type="text/css"> 
<!-- 
*{margin: 0px; padding:0px;} 
body { font-family:"宋体"; font-size:12px; color:#000; padding:100px;} 
.news{} 
.news li{ list-style:none; clear:both} 
.news li a#n1{ text-decoration:none; float:left; line-height:22px;} 
.news li a#n2{ text-decoration:none; float:right; color:#999} 
.news li a#n3{ float:right; padding-right:20px;color:#999} 
.news li a#n1:hover{ text-decoration:underline;} 
.news li a#n3:hover,.news li a#n3:hover{ text-decoration:none;} 
--> 
</style></head> 
<body> 
这是二列 
<ul class="news"> 
<li>左列,新闻标题项点击次数</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
</ul> 
</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=gb2312" /> 
<title>css多行多列的新闻模式</title> 
<style type="text/css"> 
<!-- 
*{margin: 0px; padding:0px;} 
body { font-family:"宋体"; font-size:12px; color:#000; padding:100px;} 
.news2{} 
.news2 li{ list-style:none;clear:both;margin-top:10px;border-bottom:1px dashed #ccc;height:16px; 
display:block} 
.news2 li a#n1{ text-decoration:none;float:left;} 
.news2 li a#n2{ text-decoration:none; float:right; color:#999;display:block} 
.news2 li a#n3{ float:right; padding-right:20px;color:#999; display:block} 
.news2 li a#n1:hover{ text-decoration:underline;} 
.news2 li a#n3:hover,.news li a#n3:hover{ text-decoration:none;}  
/**/ 
--> 
</style></head> 
<body> 
加条虚线 
<ul class="news2"> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
</ul> 
</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=gb2312" /> 
<title>css多行多列的新闻模式</title> 
<style type="text/css"> 
<!-- 
*{margin: 0px; padding:0px;} 
body { font-family:"宋体"; font-size:12px; color:#000; padding:100px;} 
.news{} 
.news3{ background:#ccc;} 
.news3 li{ list-style:none; clear:both; height:20px; padding-top:8px;} 
.news3 li#x1{ list-style:none; clear:both; height:20px; background-color:#f2f2f2} 
.news3 li a#n1{ text-decoration:none; float:left;} 
.news3 li a#n2{ text-decoration:none; float:right; color:#999} 
.news3 li a#n3{ float:right; padding-right:20px;color:#999} 
.news3 li a#n1:hover{ text-decoration:underline;} 
.news3 li a#n3:hover,.news li a#n3:hover{ text-decoration:none;} 
--> 
</style></head> 
<body> 
不同背景色 
<ul class="news3"> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li id="x1">>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
</ul> 
</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=gb2312" /> 
<title>css多行多列的新闻模式</title> 
<style type="text/css"> 
<!-- 
*{margin: 0px; padding:0px;} 
body { font-family:"宋体"; font-size:12px; color:#000; padding:100px;} 
.news4{} 
.news4 li{ list-style:none; clear:both;margin-top:10px; padding:10px; border:1px solid #ccc;  
display:block} 
.news4 li a#n1{ text-decoration:none;float:left;} 
.news4 li a#n2{ text-decoration:none; float:right; color:#999;display:block} 
.news4 li a#n3{ float:right; padding-right:20px;color:#999; display:block} 
.news4 li a#n1:hover{ text-decoration:underline;} 
.news4 li a#n3:hover,.news li a#n3:hover{ text-decoration:none;} 
/**/ 
--> 
</style></head> 
<body> 
边框 
<ul class="news4"> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
<li>>> 热烈祝贺weilaixu.cn隆重上线2008-08-08</li> 
</ul> 
</body> 
</html>

上記は css の複数行および複数列のニュース モード_体験交換コンテンツです。その他の関連コンテンツについては、php 中国語 web サイト (www.php.cn) にご注意ください。


声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
マウスの動きのシミュレーションマウスの動きのシミュレーションApr 22, 2025 am 11:45 AM

ライブトークやクラス中にインタラクティブなアニメーションを表示しなければならなかった場合、スライドと対話するのが必ずしも簡単ではないことを知っているかもしれません

Astro ActionsとFuse.jsでのパワー検索Astro ActionsとFuse.jsでのパワー検索Apr 22, 2025 am 11:41 AM

Astroを使用すると、ビルド中にほとんどのサイトを生成できますが、fuse.jsのようなものを使用して検索機能を処理できるサーバー側のコードが少しあります。このデモでは、ヒューズを使用して、個人の「ブックマーク」セットを検索します。

未定義:3番目のブール値未定義:3番目のブール値Apr 22, 2025 am 11:38 AM

ドキュメントが保存されている間にGoogleドキュメントに表示されるものと同様に、プロジェクトの1つに通知メッセージを実装したかったのです。言い換えれば、a

三元声明の防衛三元声明の防衛Apr 22, 2025 am 11:25 AM

数ヶ月前、私はハッカーのニュースに出演していました(1つのように)。あなたがこのアイデアに慣れていない場合(私のように

多言語翻訳にWeb Speech APIを使用します多言語翻訳にWeb Speech APIを使用しますApr 22, 2025 am 11:23 AM

サイエンスフィクションの初期の頃から、私たちは私たちに話しかける機械について空想してきました。今日は当たり前です。それでも、作成のための技術

Jetpack GutenbergブロックJetpack GutenbergブロックApr 22, 2025 am 11:20 AM

私はその日私たちにワードキャンプにいたので、グーテンバーグがコアにリリースされたときのことを覚えています。数ヶ月が今から経過しているので、ますます私たちのことを想像してください

VUEで再利用可能なページネーションコンポーネントを作成しますVUEで再利用可能なページネーションコンポーネントを作成しますApr 22, 2025 am 11:17 AM

ほとんどのWebアプリケーションの背後にあるアイデアは、データベースからデータを取得し、可能な限り最良の方法でユーザーに提示することです。そこでデータを扱うとき

「ボックスシャドウ」とクリップパスを一緒に使用します「ボックスシャドウ」とクリップパスを一緒に使用しますApr 22, 2025 am 11:13 AM

&#039;は、理にかなっていると思われることを非常に実行できる状況を少し段階的に実行しますが、CSSのトリックでそれを成し遂げることができます。これで

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強力な PHP 統合開発環境

mPDF

mPDF

mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

PhpStorm Mac バージョン

PhpStorm Mac バージョン

最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール