Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6136925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:39:50+00:00 2026-05-23T17:39:50+00:00

I am new to CSS and I’m following a book example: Iv’e copied the

  • 0

I am new to CSS and I’m following a book example:

Iv’e copied the following from the book and saved it as HTML.
all the css properties seem to work except the “content” property which does not display.Thanks in advance.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> The content property </title>
        <style type='text/css' media='all'>
            div {
                content: "Hello, world!";
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:39:51+00:00Added an answer on May 23, 2026 at 5:39 pm

    content is used with :before or :after like so:

    div:after
    {
        content: "Hello, world!";
    }
    

    Regardless, I’ve only used content for special cases (to clear floated elements, for example). I’ve never actually used this to insert content. You generally want to separate content and presentation anyway, so I think this is a bad idea. Which book are you reading? 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to add new css class or id and then write properties for html
I'm quite new to CSS / HTML, and can't find the cause of this
Since i am new to CSS, i am not sure if the following page
in the I'm painfully new to CSS (and stackoverflow!) and can't seem to get
After setting up a new CSS:hover menu it works great across the board...except in
I've a HTML markup and I've several CSS files with different properties assigned for
Hi all CSS experts, I come from the server side and must say I'm
I'd like create a new CSS class but based (inherited) from ui-state-default from jQuery
How can I achieve something simple like the following without creating a new css
I am new to Zkoss and i need to create completely new css theme

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.