html - Load different background image without loading default -
my rails project has default pattern background pages. i'm trying set root page whole-screen background image. upon loading, works expected. however, when opening page 1 can see two-step delay page first opens default colorful background, , lays image on page. there way can not load default background on 1 view in order avoid two-step view during loading?
i have given root view (static_pages#index) #landing-page id.
css:
#landing-page { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: url(ripples.jpeg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } body { background: url('congruent_pentagon.png'); }
if first background comes body, solution add different classes main , other pages body in layout
<body class="<%= current_page?('/') ? 'main-page' : 'page' %>">
and in css instead
body { background: url('congruent_pentagon.png'); }
write
.main-page { background: none; } .page { background: url('congruent_pentagon.png'); }
Comments
Post a Comment