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 44883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:43:19+00:00 2026-05-10T15:43:19+00:00

I want to use javascript to insert some elements into the current page. Such

  • 0

I want to use javascript to insert some elements into the current page. Such as this is the original document: <p>Hello world!</p>

Now I want to insert an element in to the text so that it will become:

<p>Hello <span id=span1>new</span> world!</p>

I need the span tag because I want to handle it later.Show or hide. But now problem comes out, if the original page has already defined a strange CSS style on all <span> tags, the ‘new’ I just inserted will not appear to be the same as ‘Hello’ and ‘world’. How can I avoid this? I want the ‘new’ be exactly the same as the ‘Hello’ and ‘world’.

  • 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. 2026-05-10T15:43:20+00:00Added an answer on May 10, 2026 at 3:43 pm

    Simply override any span styles. Set layout properties back to browser defaults and set formating to inherit from the parent:

    span#yourSpan {   /* defaults */   position: static;   display: inline;   margin: 0;   padding: 0;   background: transparent;   border: none;    /* inherit from parent node */   font: inherit;   color: inherit;   text-decoration: inherit;   line-height: inherit;   letter-spacing: inherit;   text-transform: inherit;   white-space: inherit;   word-spacing: inherit; } 

    This should be sufficient, although you may need to add !important if you are not using an id:

    <span class='hello-node'>hello</span>  span.hello-node {   /* defaults */   position: static !important;   display: inline !important;   ... } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 70k
  • Answers 70k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Here are some general guidelines I try to abide by,… May 11, 2026 at 12:55 pm
  • added an answer You can't, anti-aliased edges require per-pixel alpha channel (what AllowTransparency=true… May 11, 2026 at 12:54 pm
  • added an answer You don't, easily at least... the SELECT is embedded into… May 11, 2026 at 12:54 pm

Related Questions

I want to use WatiN to verify the error message in a JavaScript alert
I already started this in javascript so I don't want to use jquery but
I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom
I want to use Powershell to write some utilities, leveraging our own .NET components
Here's a question that's been haunting me for a year now. The root question
I have beeen looking around for a way to add code highlighting to my
I have a page that will list news articles. To cut down on the
I've been reading up on this topic for the past few hours, and I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.