Skip to content Skip to sidebar Skip to footer

Css Difficulty Within Loaded Div With Ajax

I am having trouble with the CSS when I load a page into div. Firefox loads CSS perfectly, but in Chrome, it does not load the CSS styles of the loaded page. It only works when I

Solution 1:

I'm guessing the page you are loading via AJAX has its own styles in the head of that page. While that could/should work, I suggest putting all the styles for your site in one or more external style sheets and load them at every page. When you then load HTML content in a div via AJAX, the styles will already be there and will be applied to the new content.

Putting styles in an external stylesheet is, in most cases, the best practice for a number of reasons.

Solution 2:

Did you forget a ; on the end of fixed?

<table style="left:100px;top:50%;position:fixed;">

Solution 3:

I would be curious to see if this:

<styletype="text/css">.mystyle {
        left:100px;    
        top:50%;    
        position:    
        fixed;
    }

       </style>

would work if it were to be formated as:

<styletype="text/css">.mystyle 
{
   left: 100px;    
   top: 50%;    
   position: fixed;
}
</style><tableclass="mystyle">

BUT, as others suggest, I would prefer to see it in an external style sheet file and linked in that way.

Post a Comment for "Css Difficulty Within Loaded Div With Ajax"