Thread: CSS Question
View Single Post
Old 11-09-2020, 11:21 AM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
CSS Question

I have <p> with text-indent = 2em since the vast majority of the time that's the default for a basic text paragraph.

Sometimes however (usually for a a group specially formatted paragraphs I use <p class="noindent">

I've tried to bracket a group with <div class="noindent"> ... </div> but the class seems to be ignored. If I can't do that, is there another way to 'turn off' indenting for a block of paragraphs?

Spoiler:
@charset "utf-8";
/* Styles for Test_CSS */
p {
text-indent: 2em;
}
.noindent {
text-indent: 0em;
}


and

Spoiler:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
<title>Test_CSS</title>
<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>

<body>

<h1>Test_CSS</h1>

<p>Some indented text </p>
<p>Some indented text </p>
<p>Some indented text </p>

<div class = "noindent">
<p>Some not indented text </p>
<p>Some not indented text </p>
<p>Some not indented text </p>
</div>

</body>

</html>
phossler is offline   Reply With Quote