What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

Code Blind and a Question about Selectors

Ahr Aitch

New member
Code Blind Question
I have a class defined with font size = 9px. The class also centers text. When I code the class into my HTML, there is no effect. My text inherits its size from the class above it.
I've looked at it so long I've gone code blind. A screenshot showing the text as displayed is attached with a fuschia rectangle around the code that is supposed to be font size = 9px.
The CSS file (clan.css) is properly linked in the HTML cod, I think. I have changed other CSS statements and seen the effects on the browser screen.

If anyone can spot what I've gone blind to, I'd very much appreciate your telling me what I'm missing. Rub my nose in it, please.

Selector Question
You can see that I used <div> selectors to apply formatting to various parts of my HTML. Is there a more appropriate selector that I should have used?

CSS:
.photo-legend
{
  text-align: center;
  font-size: 16px;
}

.small-photo-legend
{
  text-align: center;
  font: 9px;
}

HTML:
<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <link type="text/css"
        rel="stylesheet" href="clan.css" media="screen">
    <h8><!-- Date goes here -->
    </h8>

    <title> The Hutchins Clan </title>

  </head>
  <body>
    <!-- Header Goes Here; maybe just a menu row  -->
      <div class="photo-heading"> Healy and Pa</div>
    <div class="large-image"><img src="healy-and-pa-ca-1956.jpg" alt:healy and pa class="img1"></div>
      <div class="photo-legend">
    Standing in front of their home at<br>527 N. East Street, Raleigh, NC (circa 1956)
    </div>
    <hr></hr>
    <hr></hr> <!-- hor. row next page marker -->
    <div class="photo-heading">The Hutchins Family</div>
    <div class="photo-subheading">The only Photograph Ever Taken of the Whole Clan</div>
    <div class="clan-image"><img src="the-clan-in-color-cropped-with-blur.png"
    alt="the clan" class="img2"></div>
 
        <div class="photo-legend">Healy Heady Mauden Baker Hutchins and Charles
            Haddon Spurgeon Hutchins<br>
        Robert Haddon, Nancy Catherine, Mary JoAn, John Fox, James Alfred, <br>Elizabeth Lee "Baby Lee", Frank Tabor, Charles Baker, William Spurgeon "Bill"</div>
        
    <div class="small-photo-legend">(Parents, center front; offspring - left to right, youngest to oldest, with the oldest, Bill, at right front)
    </div>
    <hr></hr>
    
</body>
</html>
 

Attachments

  • VSC 1 2023-09-23_15h42_23.png
    VSC 1 2023-09-23_15h42_23.png
    39.7 KB · Views: 0
I know it's bad form to reply to one's own posts, but I found and fixed the code blind problem. The last line of the CSS, before the closing brace, should have been font-size: 9ps instead of font; 9px.

Going code blind is a tough! :cool:


I can still use advice on selectors.
 
Last edited:
Back
Top