Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved How To Add Padding To Specific Contentbox


Question

Posted · Report post

Hi,

I would like to add padding to a contentbox and several contentboxes.

I've looked into the W3SCHOOLS on Id and class but I don't seem to get it right.

1. How do I change padding on one specific Contentbox. The box i named "Contbx 1", se string below.

... more specific, what do I use in my custom code from the string below?

--- HTML--

<div class="scolumn-pad">

<section id="contentbox" class="copy no_clone section-contentbox">

<div class="copy-pad">

<div class="hentry Contbx 1">

<div class="hentry-pad Contbx 1-pad entry_content" style="padding-top: 41px; padding-left: 11px;">

</div>

<div class="clear"></div>

--- CSS--

element.style { padding-left: 11px; padding-top: 41px;

}

.hentry .hentry-pad { padding: 0 0 25px;

}

.entry_content {

padding: 0 10px;

2. How do I change padding on all my contentboxes? They are named Contbx 1, Contbx 2 and so on.

Kind regards

Share this post


Link to post
Share on other sites

7 answers to this question

Posted · Report post

you cant have spaces in classnames/ids

Thats why your css is failing

div class="contbx 1"> is a div with 2 classes, contbx and 1

Share this post


Link to post
Share on other sites

Posted · Report post

Many thanks Simon. Great

This solved my first problem.

Still I would like to understund which part of the the HTML- and CSS-string I should cut and paste into custom CSS.

It would be great to understand the logic behind this. It would save so much time.

Now I have pasted: .CbxSB2 .hentry-pad {padding-top: 42px; padding-left: 13px; }

But I also found that following will give the same result: .CbxSB2 .entry_content {padding-top: 42px; padding-left: 13px; }

Could I use anyone?

Which is the correct way to cut the correct pieces to paste in the custom sheet

Greatful for your support

Share this post


Link to post
Share on other sites

Posted · Report post

Ok, Just wished for some nice logical theory to guide me, beside the w3schools.

Anyway, thanks for your help.

I appreciate it a lot.

Share this post


Link to post
Share on other sites

Posted · Report post

You can use either of them if they work.

Share this post


Link to post
Share on other sites

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks Catrina,

Any tips on how to find out a working custom code?

Or is it just a lot of trial and error to find out?

Share this post


Link to post
Share on other sites

Posted · Report post

You'll need to make sure that you're adding #page at the beginning of your CSS so that it's specific enough to overwrite any of the existing default CSS. For the most part, it is trial and error.

Share this post


Link to post
Share on other sites