search
HomeWeb Front-endHTML TutorialCSS第一次加载失效的问题_html/css_WEB-ITnose

CSS HTML

写了一个网站,网站在第一次进入的时候css无效,刷新后显示正常。
网站中的css代码如下
    <style type="text/css">        #ShowDetailInfo li        {            list-style: none;            border-bottom-style: solid;            border-bottom-color: #C0C0C0;            height: 100px;            border-bottom-width: thin;            border-top-width: thin;            border-top-color: #C0C0C0;            border-top-style: none;        }        .img div        {            max-height: 100px;            max-width: 100px;        }        #ShowDetailInfo a        {            text-align: center;            text-decoration: none;            color: #000000;        }        .info p        {            text-align: center;            color: #696969;        }        .GoodType li        {            list-style: none;            display: inline;            width: 320px;        }        .login        {            text-align: right;        }    </style>

在firefox里面看了下,第一次进入的时候,这段css代码 只有
      .login        {            text-align: right;        }

其余的全部没有加载成功,求大神指点如何解决

回复讨论(解决方案)

应该你代码加了什么限制第一次访问什么的只输出那个类吧。。要不怎么会加载不了。。

应该你代码加了什么限制第一次访问什么的只输出那个类吧。。要不怎么会加载不了。。

后来 我又尝试了好几次,发现的问题是,如果从其他页面点击链接进入 这个页面,那么回出现这个问题,如果是直接在地址栏输入该页面url 则正常显示...

怎么没有人 回答啊...
大神都去哪里了.....

不是一个页面。

不是一个页面。
地址都是相同的url...

检查过滤器什么,你的应该不是.html之类的静态文件,应该是url重写过的,进行了一些判断什么的。。

如果是.html文件不会出现这种问题。如果网速慢也不会只下载最后的,只可能是下载了前面的,后面没有下载

谢谢已经找到问题了
这边使用了模板,和模板有点冲突,已经解决了 谢谢

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
The Versatility of HTML: Applications and Use CasesThe Versatility of HTML: Applications and Use CasesApr 30, 2025 am 12:03 AM

HTML is not only the skeleton of web pages, but is more widely used in many fields: 1. In web page development, HTML defines the page structure and combines CSS and JavaScript to achieve rich interfaces. 2. In mobile application development, HTML5 supports offline storage and geolocation functions. 3. In emails and newsletters, HTML improves the format and multimedia effects of emails. 4. In game development, HTML5's Canvas API is used to create 2D and 3D games.

What is the root tag in an HTML document?What is the root tag in an HTML document?Apr 29, 2025 am 12:10 AM

TheroottaginanHTMLdocumentis.Itservesasthetop-levelelementthatencapsulatesallothercontent,ensuringproperdocumentstructureandbrowserparsing.

Are the HTML tags and elements the same thing?Are the HTML tags and elements the same thing?Apr 28, 2025 pm 05:44 PM

The article explains that HTML tags are syntax markers used to define elements, while elements are complete units including tags and content. They work together to structure webpages.Character count: 159

What is the significance of <head> and <body> tag in HTML?What is the significance of <head> and <body> tag in HTML?Apr 28, 2025 pm 05:43 PM

The article discusses the roles of <head> and <body> tags in HTML, their impact on user experience, and SEO implications. Proper structuring enhances website functionality and search engine optimization.

What is the difference between <strong>, <b> tags and <em>, <i> tags?What is the difference between <strong>, <b> tags and <em>, <i> tags?Apr 28, 2025 pm 05:42 PM

The article discusses the differences between HTML tags , , , and , focusing on their semantic vs. presentational uses and their impact on SEO and accessibility.

Please explain how to indicate the character set being used by a document in HTML?Please explain how to indicate the character set being used by a document in HTML?Apr 28, 2025 pm 05:41 PM

Article discusses specifying character encoding in HTML, focusing on UTF-8. Main issue: ensuring correct display of text, preventing garbled characters, and enhancing SEO and accessibility.

What are the various formatting tags in HTML?What are the various formatting tags in HTML?Apr 28, 2025 pm 05:39 PM

The article discusses various HTML formatting tags used for structuring and styling web content, emphasizing their effects on text appearance and the importance of semantic tags for accessibility and SEO.

What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?What is the difference between the 'id' attribute and the 'class' attribute of HTML elements?Apr 28, 2025 pm 05:39 PM

The article discusses the differences between HTML's 'id' and 'class' attributes, focusing on their uniqueness, purpose, CSS syntax, and specificity. It explains how their use impacts webpage styling and functionality, and provides best practices for

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment