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

  • Home
  • SEARCH
  • 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 7420419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:14:08+00:00 2026-05-29T08:14:08+00:00

Here is the css: #content ul { font-size: 12px; } I am trying this:

  • 0

Here is the css:

#content ul {
               font-size: 12px;
           }

I am trying this:

document.getElementById("content ul").style.fontSize = 8px;

But this is not working for me. Can anybody suggest how to do this?

  • 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-29T08:14:09+00:00Added an answer on May 29, 2026 at 8:14 am

    Two issues:

    1. Style properties are strings, so you need "8px" rather than 8px.

    2. getElementById gets elements by ID. You’re passing in a compound selector (and you’re missing the # from it). You’ll have to use an ID and then find the children (via getElementsByTagName), or use querySelector (for the first matching element) or querySelectorAll (for all matching elements) instead. (Note that although well-supported in general, some older browsers don’t have those last two; details.)

    So for instance, here’s how you would change the first matching element’s font size on browsers with querySelector support:

    document.querySelector("#content ul").style.fontSize = "8px";
    

    Or all of them

    var list = document.querySelectorAll("#content ul");
    var index;
    for (index = 0; index < list.length; ++index) {
        list[index].style.fontSize = "8px";
    }
    

    Or on older browsers:

    var content = document.getElementById("content");
    var list = content.getElementsByTagName("ul");
    var index;
    for (index = 0; index < list.length; ++index) {
        list[index].style.fontSize = "8px";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the CSS .box { background-color: #CCCCCC; } .box-title { font-size: small; font-weight: bold;
I have my css as shown here body { margin:0px auto; font-family:Arial,Helvetica,sans-serif; font-size: 12px;
Total noob question, but here. CSS .product__specfield_8_arrow { /*background-image:url(../../upload/orng_bg_arrow.png); background-repeat:no-repeat;*/ background-color:#fc0; width:50px !important; height:33px
My css file present in css/style.css : body { background-color: #fff; margin: 40px; font-family:
I need some advanced CSS help here. I have a login button and a
It has to be simple, here's my CSS: .progressImage { position:relative; top:50%; } .progressPanel
Here is a snippet of CSS that I need explained: #section { width: 860px;
Here is the problem: we have lots of Javascripts and lots of CSS files,
As detailed here among other places, the only valid characters in a html/css class
Alright, I'm having some issues and I believe it's a CSS one. Here is

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.