简体   繁体   中英

Side-by-side divs in a WordPress theme

HTML

CSS of child theme

CSS of parent theme can be found in the directory www.guestvibe.com/wordpress/wp-content/themes/zincious/css/ and are called:

  • admin
  • color
  • layout
  • ie
  • navigation
  • pagination
  • required
  • slideshow
  • typography

I know this sort of positioning question has been done to death but I'm finding it difficult because of the nature of editing an existing theme.

Essentially, I'd like to position #left and #right next to each other within #featured, but #body below it is giving me problems. Currently, #right is found inside the blue, stripy #body.

My attempt is commented out in the child CSS, but that only caused more havoc.

Add the following definitions:

#left {
    width: 50%;
    float: left;
}
#right {
    width: 50%;
    display: block;
    float: right;
}
#body {
    clear: left;
}

Of course, you can make #left and #right whatever dimensions you'd like. I just made them 50% for illustrative purposes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM