HELP !!

The header to my website is designed in css with <div> tags and some times the whole background does not load....any thoughts?

Also I am considering the possibility that my header should not call to my stlye.css file, but that the header should be a table with the table having it own style...any thoughts on this would be really appreciated

thank you
sean

Dani AI

Generated

Following 's report that the header background sometimes fails to load, several replies suggested hosting or embedding the stylesheet (, ) while asked for the page code. Both hosting problems and a missing stylesheet can cause this symptom, but a few front-end checks usually expose the real cause faster than switching to table-based layout or permanently inlining CSS.

Steps to diagnose and fix:

  • Open the browser Network panel (see Network Monitor) and watch the requests for the stylesheet and the header image. 404/403 or 0-length responses indicate file/path/permission issues; long timeouts point at the host.

  • Verify the stylesheet link is in the document head and that the server returns the correct MIME types for CSS and images (MIME types). Incorrect headers can make resources behave unpredictably.

  • Remember that URLs in CSS are relative to the stylesheet file, not the HTML page. For example:

    .site-header {
      background: url('../images/header-bg.png') no-repeat center top;
    }

    Incorrect relative paths are a very common cause of intermittent missing backgrounds when pages or assets move.

  • Load the image URL directly in a browser to rule out hotlink/referrer blocking or permission problems. Clearing browser cache or using a versioned CSS filename can reveal caching-related issues.

Embedding CSS can temporarily hide a failing asset request but removes cross-page caching and masks the underlying server problem. Tables are not a recommended replacement for CSS layout. If issues persist after the front-end checks, server logs, hosting limits, and any hotlink/security modules (for example mod_security) should be inspected. For reference on background rules and URL handling see MDN’s background-image and [url()](https://developer.mozilla.org/en-US/docs/Web/CSS/url()) pages.

Recommended Answers

All 3 Replies

It could be due to your server not being able to serve all files to a client. You may want to try a different host if this is becoming a problem.

Secondly, another thing you can do is embed the css file into the html source of your document. Either manually paste it in, or if you're using PHP or some other scripting language, you can add a command to dynamically add the css to the page when a request is given. Here is how a page would look with embedded css:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>MyPage</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

  <style type="text/css">
 /* css goes here... */

ul.menu,
ul.menu li a {
    text-decoration: none;
    padding: 5px 15px 6px; 
</style>
.
.
.

Hope this helps

can you post the code, would be much easier to figure out

Joeprogrammer is right. Its probably the server. Putting your CSS in the HTML would help cut down on unloaded files because there are less files to load and if the CSS file does not load then your background file will not load if it is specified in the CSS. Finding another server would be your best bet.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.