Jump to content


Photo
- - - - -
Resolved

How To Add Padding To Specific Contentbox

contentbox padding

  • Please log in to reply
7 replies to this topic

#1 texasx

texasx

    Member

  • Members
  • 26 posts
  • LocationSweden
  • Framework Version:2.35
  • Country: Country Flag

Posted 20 November 2012 - 11:15 AM

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

#2 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 20 November 2012 - 12:14 PM

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

#3 texasx

texasx

    Member

  • Members
  • 26 posts
  • LocationSweden
  • Framework Version:2.35
  • Country: Country Flag

Posted 20 November 2012 - 01:19 PM

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

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 20 November 2012 - 04:05 PM

You can use either of them if they work.

#5 texasx

texasx

    Member

  • Members
  • 26 posts
  • LocationSweden
  • Framework Version:2.35
  • Country: Country Flag

Posted 20 November 2012 - 07:44 PM

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?

#6 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 20 November 2012 - 07:51 PM

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.

#7 texasx

texasx

    Member

  • Members
  • 26 posts
  • LocationSweden
  • Framework Version:2.35
  • Country: Country Flag

Posted 22 November 2012 - 01:44 PM

Ok, Just wished for some nice logical theory to guide me, beside the w3schools.
Anyway, thanks for your help.
I appreciate it a lot.

#8 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 22 November 2012 - 04:06 PM

The topic was marked as resolved.





Also tagged with one or more of these keywords: Resolved, contentbox, padding