Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のように段落を書く必要があります
1st line: align:center 2nd line: align:left 3rd line: align:center 4th line: align:left
このようになるはずです。
CSSを使用してそれを行うにはどうすればよいですか。
nth-child(even)セレクターで試すことができます
nth-child(even)
p:nth-child(even) { text-align:center }
このフィドルをチェック
編集:Bartdudeは正しいです。この解決策は、各段落を区切る場合にのみ機能します。
テキストの各行を含む 1 つのブロック要素が必要です。すべてのテキストを含むapタグしかない場合、それは不可能です。