How do I add padding/margin?
ChancyRat
Registered Users Posts: 2,141 Major grins
I spent all day learning the basics to make this happen. From the ground up, A-Z (or maybe A-C is where I am.
It's in the footer on the home page but I'm not sure where it will finally end up or consist of. Now, though, I'm stuck.
How can I add padding, or margin, or whatever it is called so that the transparent yellow on top of the flower image, has flowers on the top and bottom horizontal borders?
This is the best I could come up with.
Any other corrections you can spot would be gratefully welcomed.
EDIT: This is an HTML block inside the footer, in case that wasn't obvious.
It's in the footer on the home page but I'm not sure where it will finally end up or consist of. Now, though, I'm stuck.
How can I add padding, or margin, or whatever it is called so that the transparent yellow on top of the flower image, has flowers on the top and bottom horizontal borders?
This is the best I could come up with.
Any other corrections you can spot would be gratefully welcomed.
<div class="footer"> <div style="font-size: 20px; padding: 15px; color: #000; margin-right: 20px;"> This is a text inside a div element. We are still in the div element. </div></div>
div.footer { background-color: #FBF2C9; opacity: 0.8; margin-left: auto ; margin-right: auto ; width: 820px; height: 260px; filter: alpha(opacity=80); /* For IE8 and earlier */ } { background-image: url('/photos/i-s4c2RzJ/1/S/i-s4c2RzJ-S.jpg'); background-repeat: repeat; /* background-position: 50% 0, 50% 0 !important; */ }
EDIT: This is an HTML block inside the footer, in case that wasn't obvious.
0
Comments
No need for "div" in front of ".footer", you have margin twice, and best to use a gif or png instead of opacity. Margin "0 auto" centers, so now adjust the height and width. Padding or margin your top and bottom if needed
For the background you need to add the background element
Moving it back to HTML, and then trying to work with putting the flowers in a DIV, I now have this code. But the Blue should be on top of the flowers (it was on top but adding the DIV moved it to the background), and the margin is still missing from the top. There is also no transparency, but I did change the photo to .png.
I realize my coding language is that of an infant but would you direct me towards a solution? Thanks.
Better to use style the text in the .flower class.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
[html]
<div class="footer">
This is a text inside a div element. We are still in the div element.
</div>
[/html]CSS:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
The flower image is a png now, as Todd instructed.
What will bring back the opacity of the blue on top?
HTML:
[html]
<div class="footer">
<div class="flowers">
<p>This is a text inside a div element. We are still in the div element.</p>
</div>
</div>
[/html]
CSS:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
I saw only flowers and type. I changed the margins to see if the blue was behind the flowers, and it was.
The older code, I had to put the section in the order of overlay, so I took a chance and reversed both of them (html and css), and VOILA, I got it. Obviously have decisions to make on choice of image and color, but at least I can experiment now.
Did your test achieve an image like this, and why wouldn't the code do so for me?
Would you know how to center the blue within the flowers, all four borders? I also need to figure out why the typeface is not line spaced properly and has no padding from the top of the image.
Here's what I put:
Thank you for getting me on the right track. :ivar<img src="https://us.v-cdn.net/6029383/emoji/bowdown.gif" border="0" alt="" >ivar
Todd, you said, " best to use a gif or png instead of opacity".
So, does the code in my last comment, completely miss the point you are making?
W3S seems to interchange opacity and transparency in many places, so I am not tuning in to the point.
Are you saying I should make the Blue color, an image with transparency?
This might have been plain as day to everyone but me.
So - never use opacity as the code above does?
Thanks.
You need to make sure both .flowers and .footer has the same height/width (in red).
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Hmm, I'm not clear. I don't want them the same. I'd like to see the flowers around the perimeter of the entire area. As if the flowers were a frame/border.
So in the image above, I like the bottom border.
The right side "border" is too wide.
There is zero border on the left and top. I'd like there to be a border. Centered like a photo.
On your last example (image), is the flower supposed to be a border, with the blue centered?
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Exactly. Flowers are both a background to the blue, and a border on the outside of the blue.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
I wonder why the code doesn't work for you? I guess that's neither here nor there.
I'm looking at this on FF 25.0.1 but I checked and both IE and Chrome show the same thing.
I have reverted the color to a pale yellow, and the text to a header which defaults to the site font of Buda in black.
Still missing the top "border" of flowers. I just think this is all very odd.
The image is reduced in size for DG's limit.
HTML
[html]
<div class="footer">
<div class="box">
<p>This is a text inside a div element. We are still in the div element.</p>
</div>
</div>
[/html]
CSS:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
That's all I have to say, Mike.
I wasn't able to get to this until I finished work this week, but it took me all of 2 seconds after work ended to get to try this.
THANK YOU.
I reduced the image to fit DG's limit.
The outer yellow border is my site's background color.
I don't know what image I will end up using, or color, but as for getting the code??? =
I'm so happy I can't breathe.
barbbarbbarbbarb
Glad it worked!
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Doesn't your legacy does the same thing?
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
No, Mike. And I have a feeling that came from some ancient javascript that Jfriend wrote for me. It has trickled back to me - it was long ago.
I 'fixed' this by removing the opacity but then that kind of defeats the purpose. It was in the midst of constructing this page that I remembered angel Jfriend's java.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
You can see the javascript on my advanced customization section?
I'm not a Javascipt person, but I didn't see anything that would "fix" that. Here is my test page. The top one is the one I gave you, just changed the background and colors. The bottom is straight from your old page.
http://mike.imagesinthebackcountry.com/Test-Page/
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Went back into DG's ancient history. My GOD Jfriend was a blessing.
So PLEASE smumug BRING HIM BACK by opening Java to his magical potion-making.
Anyway, grumble grumble, here is the thread on the subject:
http://www.dgrin.com/showthread.php?t=191786&highlight=background
and I did misremember about java. I think the piece I need to focus on is Jfriend's statement from message #19, which I don't follow, I need to settle and stare at the code (hopefully that is all I have to do, lol), but here it is fyi: