Set page load to black instead of white background

2019-08-07 17:43发布

Link to website:

http://www.ideagang.co/home.php

Is it possible to set the background to black when click from 1 page to another? Right now the website load perfectly with the black background, it's just that when I navigate from one page to another the page flickr for a second.....

Is there anyway to resolve this by setting the background to black when loading page internally?

3条回答
Emotional °昔
2楼-- · 2019-08-07 17:51

I very much doubt this would be possible with CSS.

Have you tried using

<body background="#000"> 

It is long deprecated but may help. I think you will still get a white flash but it may be for less time.

You could also try putting a small block of CSS as the first thing in the header after your title.

查看更多
Deceive 欺骗
3楼-- · 2019-08-07 18:00

the html5 method of doing this via CSS is now:

<body style="background-color:#000">

also tried putting this CSS styling as the first thing in the <head> :

<style type="text/css">
    body{background-color:#000}
</style>

...but on my application it still resulted in a momentary white flash

查看更多
爷的心禁止访问
4楼-- · 2019-08-07 18:05

Not using only CSS. The browser's default color for the background is white, so the flicker you see is the default coming through for a split second before it has a chance to read the CSS rule to make it black.

The only way I can think of to get around this would be to load the first page, and then switch from page to page via javascript, loading them in to the exiting page. No reloads means no flicker. In my opinion, that is a ton of overhead for very little value, so I would suggest just living with it.

查看更多
登录 后发表回答