Community Forums › Forums › Archived Forums › Design Tips and Tricks › Problem with backgrounds in css in Parallax
Tagged: background, css, parallax-pro
- This topic has 8 replies, 2 voices, and was last updated 7 years, 10 months ago by
SavvyJackie.
-
AuthorPosts
-
May 29, 2015 at 8:32 am #154095
achuka
MemberCan someone explain why this html:
<section class="book3"> <div class="one-half first" style="text-align: center;">Teaching Resource 01<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png"><img class="aligncenter wp-image-177 size-full" src="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png" alt="TeachingResource01" width="200" height="200" /></a></div> <div class="one-half" style="text-align: center;">Teaching Resource 02<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png"><img class="aligncenter size-full wp-image-176" src="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png" alt="cw02" width="200" height="200" /></a></div> <div class="one-half first" style="text-align: center;">Teaching Resource 01<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png"><img class="aligncenter wp-image-177 size-full" src="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png" alt="TeachingResource01" width="200" height="200" /></a></div> <div class="one-half" style="text-align: center;">Teaching Resource 02<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png"><img class="aligncenter size-full wp-image-176" src="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png" alt="cw02" width="200" height="200" /></a></div> <div class="one-half first"></div> </section>
and this css
section.book3 { padding: 20px; color: #000000; margin-top: 70px; border-bottom: 2px solid #0a326b; background-image: url('http://jonwalter.net/wp-content/uploads/2015/05/redbc.png'); background-position: center center; background-attachment: fixed; background-repeat: no-repeat; }
does not allow the background image (a solid red) to show behind the images...
I have also tried with background color
http://jonwalter.net/close-to-the-wind/
and with a much smaller background image set to repeat - still the colour does not fill the div as intended and expectedMay 29, 2015 at 10:48 am #154136SavvyJackie
MemberHi,
I do not see a section with class book3 on your homepage. This is what appears where a section class book3 might go.<div id="tr" class="_mPS2id-t mPS2id-target mPS2id-target-first mPS2id-target-last"> <span><p></p> <div class="book3"> <div class="one-half first" style="text-align: center;">Teaching Resource 01<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png"><img class="aligncenter wp-image-177 size-full" src="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png" alt="TeachingResource01" width="200" height="200"></a></div> <div class="one-half" style="text-align: center;">Teaching Resource 02<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png"><img class="aligncenter size-full wp-image-176" src="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png" alt="cw02" width="200" height="200"></a></div> <div class="one-half first" style="text-align: center;">Teaching Resource 01<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png"><img class="aligncenter wp-image-177 size-full" src="http://jonwalter.net/wp-content/uploads/2015/05/cw01.png" alt="TeachingResource01" width="200" height="200"></a></div> <div class="one-half" style="text-align: center;">Teaching Resource 02<a href="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png"><img class="aligncenter size-full wp-image-176" src="http://jonwalter.net/wp-content/uploads/2015/05/cw02.png" alt="cw02" width="200" height="200"></a></div> <div class="one-half first"></div> </div> <p> </p></span></div>
Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie
Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂
May 29, 2015 at 11:12 am #154139achuka
MemberYes, that's because, in the absence of a very quick response, I've continued experimenting and wanted to see if changing from <section> to <div> made any difference...
The circular Resource links (placeholders at the moment) are supposed to be in a block of red background colour, but as you will see the colour does not extend very far, and that is what I am puzzling to account for / correct
May 29, 2015 at 12:01 pm #154145achuka
Memberhave continued experimenting with different height attributes - all to no avail
think the solution/explanation is going to be connected with image positioning
but this is a VERY straightforward thing I'm aiming for here, which would have been a piece of cake in html/table/rows&columns terms - not sure why it should be perplexing me in css
May 29, 2015 at 12:24 pm #154148SavvyJackie
MemberTry specifying a min-height of 520px or so instead of height: auto;
Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie
Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂
May 29, 2015 at 1:09 pm #154149achuka
MemberI have tried specifying minimum height, but it's not a responsive solution...
May 29, 2015 at 1:25 pm #154150SavvyJackie
MemberAdd overflow: hidden; to the section.book3 - that should do it and leave the height as auto.
Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie
Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂
May 29, 2015 at 1:50 pm #154154achuka
MemberThank you!
That works nicely - I don't fully comprehend why yet, but am happy to end the day with it working 🙂Much appreciate your input.
May 29, 2015 at 1:53 pm #154155SavvyJackie
MemberMy pleasure. One of those quirky things I guess.
"Overflow:
The second method, which is preferred by most people (I think) is to change the CSS of the parent element so that the overflow is anything but "visible". So setting the overflow to "hidden" will force the parent to stretch beyond the bottom of the floated child. This is only true if you haven't set a height on the parent, of course."
Web Designer and Developer at Savvy Jackie Designs | Lucky with plants | @SavvyJackie
Got your question answered here? Please pay it forward by helping someone else. I’m sure there is at least one question you can answer. 🙂
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.