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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:53:54+00:00 2026-06-01T20:53:54+00:00

I have two CSS files and I can only edit the 2nd file. My

  • 0

I have two CSS files and I can only edit the 2nd file.

My HTML element:

<div class="ui-header ui-header-fixed"></div>

First CSS file sets:

.ui-header        { position: relative };
.ui-header-fixed  { position: fixed };

So when position:fixed is not supported, the CSS falls back to position:relative. However, I need it to fallback to position:absolute in this specific case only.

I’m looking for a way to override the above CSS from the 2nd file with position:absolute, but only if position:fixed is not supported.

Question:
Is this possible at all? I can’t use Jquery to change the CSS directly, but if there is a JQuery test for position:fixed being supported, that would be useable (set a class add a CSS rule)

  • 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-06-01T20:53:57+00:00Added an answer on June 1, 2026 at 8:53 pm

    Can you edit the element? In your second stylesheet (assuming it is listed second in the head), add

    .ui-header-abs        { position: absolute };
    

    and change the element itself to

    <div class="ui-header ui-header-abs"></div>
    

    Failing that: If you mean for one document only, and you can edit its <head> element, you might want to try inserting

    <style type="text/css">
    .ui-header        { position: absolute }
    .ui-header-fixed  { position: fixed }
    </style>
    

    I’m fairly sure you don’t actually need the second rule, actually. The precedence rules still trip me up sometimes, but IIRC a style element in the document overrides an external stylesheet (for the same selector), so this should override the two rules in that first (uneditable) stylesheet.

    If you can’t get that style element into the header, it will probably work in the body element, but that’s not valid.


    I’d need to play with it, but this should be solvable without DOM trickery using plain old CSS and its precedence rules; I don’t understand why there’s a need to complicate matters with jQuery in this case.

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

Sidebar

Related Questions

If I have two css files: File 1: .colorme { background-color:Red; } File 2:
I have created tab style interface using css and javascript with only two tabs
I have two CSS files in my web app: reset.css and screen.css. They appear
When loading two CSS files via an include I am only seeing one of
I have a web page for which I made two css files, one for
I currently have all my web based files (.html .css. js) in one directory
I want to have two div's side-by-side with the left one fixed and the
Lets say you have lots of html, css, js, img and etc files within
I have a javascript function that switch from two different css files that affect
I have two CSS rules following each other: .some td:first-child:before { content:url('path/to/image.png') ; }

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.