Home › Forums › Weaver Xtreme Theme › How to create colored sections across a page
- This topic has 24 replies, 3 voices, and was last updated 8 years, 2 months ago by
scrambler.
-
AuthorPosts
-
July 5, 2015 at 16:53 UTC - Views: 7 #23222
scrambler
ModeratorWhat is easier is a personal question, but none are complicated anyway.
You can try the div method right away, Create a test page, switch the content editor to text mode, and put the following HTML in it.
<div class=”wvrx-fullwidth mydiv” style=”background-color:grey;”> Add some content here like test images etc… </div>
<div class=”wvrx-fullwidth mydiv” style=”background-color:yellow;”> Add some content here like test images etc… </div>
<div class=”wvrx-fullwidth mydiv” style=”background-color:blue;”> Add some content here like test images etc… </div>- Then add basic Styling for your div using the mydiv class by putting CSS rules in Main Options > Fonts & Custom > Custom CSS Rule box
.mydiv {padding:10px;width:100%;}
If you would be using posts, you don’t type the HTML above. Instead you start by creating one post for each section you need. Give them all a specific category so you can filter them in your page and out of any other post page. Then in each post editing page, you will set the color for the post BG and the extended BG color (Plus options)
Once that is done, you create a page, select the “page with posts” template for it, and in the Category filter box, you type the category used for this posts to select them.
You also add the two rules below in the Per page style box of that page editing page (Plus Option)
#content {overflow:visible;}
#container {overflow:visible;}July 5, 2015 at 17:49 UTC - Views: 2 #23223Shama
BlockedThank you for all the details. I tried the div method and got it to work right away.
Couple of questions:1. Can I fine tune the colors with color codes? If so, how would the code look like then?2. Does this method work only on full width layouts, or could I use it if I have a frame around the site like in this example:3. If it only works with full width layouts, is it possible to specify that only certain pages use a full width layout, and other pages keep the frame as in the example site above. In other words, would I have to eliminate the frame on all pages, or can this be done on a page by page basis?July 5, 2015 at 19:04 UTC - Views: 3 #23224scrambler
Moderator1- of course, you can use any CSS hex code you want, or rgb value code. If you do not know the code, you can use any color option box in weaver admin to select a color and copy the code from there.
it will then look like background-color:#445654;
2- If you do not want full width (browser edge to edge), then just remove the wvrx-full-width. In that case the div will only be 100% of the content area. Eventually it will need some tweaking as you may want to remove some right and left padding on the content area which can easily be done.
the code would look like
<div class=”mydiv” style=”background-color:grey;”> Add some content here like test images etc… </div>
<div class=”mydiv” style=”background-color:yellow;”> Add some content here like test images etc… </div>
<div class=”mydiv” style=”background-color:blue;”> Add some content here like test images etc… </div>3- Not 100% sure I follow, but if you wanted only some pages to use true full width blocks, we could give you CSS to eliminate the frame on these pages
July 5, 2015 at 19:45 UTC - Views: 1 #23225Shama
BlockedFantastic! Much easier than I had thought at first with my limited coding skills.
I played around with one test page and set up one full width section and one which is not full width.Is there a way to extend the yellow section right to the edge of the page border?And what would the code be to eliminate the page border on this page only?July 5, 2015 at 20:48 UTC - Views: 6 #23226scrambler
ModeratorYou have a 5% right and left padding on the content area, as well as a 10px right and left padding on the wrapper.
This could be removed globally with a zero in MAin Options > Content Areas > Content Area > PAdding Left and right boxes
and a zero in Main options > wrapping areas > Wrapper Area > Right and left padding boxesOr, to only remove the paddings on that specific page, add the rule below in Main Options > Fonts & Custom > CUstom CSS Rule box
.page-id-2038 #content {padding-left:0;padding-right:0;}
.page-id-2038 #wrapper {padding-left:0;padding-right:0;}You will probably want to add padding to the content of your colored div, using the mydiv class rule as I explained initially
For other pages, you can find the page id # on the page editing page
To remove the border and shadow, change the rules to
.page-id-2038 #content {padding-left:0;padding-right:0;}
.page-id-2038 #wrapper {padding-left:0;padding-right:0;border:none !important;-moz-box-shadow:none !important;-webkit-box-shadow:none !important;box-shadow:none !important;}July 6, 2015 at 03:09 UTC - Views: 2 #23227Shama
BlockedGreat, I will play with these options. One more question – if I add all this code to Weaver Xtreme and wordpress, is there any possibility that any of it would get deleted with an update of either Weaver or wordpress?
July 6, 2015 at 03:29 UTC - Views: 2 #23228scrambler
ModeratorAll options and Custom CSS are saved in the database, they are safe in any update.
That being said, I strongly advise to do two things every time you change your design
In Save / restore page, click Save to create a duplicate of the settings in the database that could be restored with the restore button.
Then below that click Download ALL settings to keep a local copy of all your settings in case of a problem
July 6, 2015 at 08:12 UTC - Views: 4 #23229Shama
BlockedI ran into a little snag. I added some padding to my div (.mydiv {padding:20px 0px 1px 20px;width:100%;}. However this extends the colored section to the right, so now there is less margin on the right than on the left of the section. So now the colored section does not look properly centered anymore. How do I deal with this?
Here is the imbalanced effect: http://thaihealingmassage.com/info/test/Another question: What code would make the corners of the colored content sections rounded? Something like on this page: http://www.thaihealingmassage.com/certification/July 6, 2015 at 15:42 UTC - Views: 1 #23230scrambler
ModeratorYes, my bad, you need to add another rule in mydiv so the width includes the padding,
.mydiv {padding:20px;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}
For rounded corners, add the CSS property below to that same rule
border-radius:20px;
You can find CSS rules in any CSS reference site like
http://webdevrefinery.com/forums/topic/6-just-starting-htmlcss/
-
AuthorPosts
- You must be logged in to reply to this topic.