Hi


I have no clue why I am not able to color the <p> </p> portion of this website. This code: p { Color: red;} should make all paragrahps red color, but I have no clue why it does not work Here is the entire code below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>S&Z Autos, LLC</title>
<style type="texte/css">
p { Color:  red;}




</style>
</head>
<body>
<h1>Welcome to S&Z Autos</h1>
<p>
Our mission is to make sure our customers are satisfied for the vehicle they purchase from us.
more that 60% of our customers are repeat customers. Our mission is to tell our customers everything we know about the vehicle that he/she is
interested in. 
</p>
</body>
</html>

thanks

Sam

Dani AI

Generated

Quick diagnostic and clarification: the stylesheet block in the posted XHTML wasn’t being treated as CSS because the style element’s MIME/type value was misspelled (the extra “e”). As noted, fixing that lets the browser recognize the block as CSS; in XHTML enumerated attribute values are treated case‑sensitively, so the exact value matters. (developer.mozilla.org)

About lowercase: is right to flag casing for XHTML element and attribute names (those must be lower‑case). However, CSS property names themselves are defined as case‑insensitive by the CSS spec, so an uppercase property name would generally still be parsed — lowercase is simply the established convention and reduces confusion. (w3.org)

Other common reasons a rule “doesn’t work”: a previous syntax error in the stylesheet can cause the parser to skip later declarations; a more specific selector, inline style, or !important can override the rule; the stylesheet might not be loaded (network 404) or the browser could be showing a cached copy. Useful debugging workflow: open the browser devtools, inspect the paragraph element, check the Styles and Computed panes to see which rule is applied and where it came from, and look at the network panel for missing files. Note that CSS parsers silently discard invalid declarations rather than throwing visible errors, so a small typo earlier can hide later problems. (developer.mozilla.org)

Practical best practices: when working with XHTML keep tags and attribute names lower‑case; prefer omitting the type attribute in modern HTML5 (the default is CSS) but ensure correct values when using strict XHTML; validate markup to catch typos; and prefer external stylesheets for easier debugging and caching control. Credit to for spotting the typo and to for the casing reminder. (developer.mozilla.org)

Recommended Answers

All 2 Replies

G'day! Simply replace "texte" with "text"

Upper case is also not allowed in tag, style, and attribute names and values. Replace Color with color.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.