I have a page in the railway app that I want to present the background image (I call it "glow" Jpg " ), And are struggling to work it properly. (Other pages have a simple pattern background that looks fine.):
Body {background-image: url ("in my application.css.scss file pixel_we Ave.png ");}
I have searched the top and best of all to get the glow.jpg For the top of the page (about exact size / location about a jumbotron - I'm also using Bootstrap, BTW), with the bottom part of the image cutoff. background is tried: Image- Url ('glow.jpg')
, background image: url ('glow.jpg')
, and some other. Path property / image is
Recently I separated the CSS for this homepage (Glow.JPG BG will be there) in my file, homepages.css.scss here:
html body .intro-header {background: url (" glow.jpg ") No repeat center center was fixed; -WebKit-Background-Size: Cover; -MOZ-BACKGROUND-SHAPE: COVER; -o-background-shape: cover; Background size: cover; } .intro-header {padding-top: 50px; Padding-bottom: 50px; Text align: center; White color; }
and here is html.erb:
& lt;% content_for (title," concert | home ")% & gt; & Lt; Div class = "intro-header" & gt; & Lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-lg-12" & gt; & Lt; Div class = "intro-message" & gt; & Lt; H1 & gt; Welcome home & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; Another Note; I have an application.html.erb file which partially presents the header on every page (which I also want on the homepage), which is just a navbar. I wonder if it can be quite conflicting?
Edit: Rail 4.1.5. And here's a screenshot. Actually, I want a background pattern that can be replaced with any other image, which is to fill the entire pages under the Naubar.
Thanks for your help! Please tell me if I can provide more information. Thanks for the tip from @MATD, I was able to work on the basis of the answer - my name was
I now have the "Homepage" controller:
DIF index @ homepage_clash = true end
and application.html.erb:
< P> & lt; Body class = "& lt;% = @homepage_class? 'Homepage':"%> " & Gt;
I have defined the body.homepage
in the application.css.scss file and added it to the body tag of the page on which I want the background.
No comments:
Post a Comment