Wordpress box around text [SOLVED]

by DaveC2
10 replies
  • WEB DESIGN
  • |
In the past, when I've wanted to place boxes around text using Wordpress then I've used either a table or imported an image of text surrounded by a box. Does anyone know if there's an alternative way to draw a box around some text (using WP) other than using these two methods?

Dave
#box #text #wordpress
  • Profile picture of the author DaveC2
    I have since seen that it may be possible using inline CSS so I'll do some more reading on this.
    {{ DiscussionBoard.errors[5270487].message }}
    • Profile picture of the author AnniePot
      Add the following to your css stylesheet (adjust as necessary):


      .box {
      background-color:#D4D4D4;
      color:#000000;
      width:450px;
      padding:15px;
      border:1px solid #000000;
      }


      and then in your post, all you will need to enter is:
      <div class="box"> text in box </div>
      {{ DiscussionBoard.errors[5271603].message }}
      • Profile picture of the author DaveC2
        Originally Posted by AnniePot View Post

        Add the following to your css stylesheet (adjust as necessary):


        .box {
        background-color:#D4D4D4;
        color:#000000;
        width:450px;
        padding:15px;
        border:1px solid #000000;
        }


        and then in your post, all you will need to enter is:
        <div class="box"> text in box </div>
        I think I must have done something wrong. I put the '.box' structure above in my custom.css file. At the moment the text is displayed in the post as black text on the existing white background. There doesn't appear to be a visible border or background. Changing the 'color' parameter doesn't affect the text colour so I may have put the '.box' structure in the wrong place.
        {{ DiscussionBoard.errors[5272631].message }}
        • Profile picture of the author Istvan Horvath
          Originally Posted by DaveC2 View Post

          I think I must have done something wrong. I put the '.box' structure above in my custom.css file.
          Yeah... (to doing something wrong).
          1st wrong: not telling us the name of the theme.
          2nd. Most themes don't have a "custom.css" file so they won't read it if you just create it.
          3rd. Did you try putting the CSS code in style.css?
          Signature

          {{ DiscussionBoard.errors[5272782].message }}
          • Profile picture of the author DaveC2
            Originally Posted by Istvan Horvath View Post

            Yeah... (to doing something wrong).
            1st wrong: not telling us the name of the theme.
            2nd. Most themes don't have a "custom.css" file so they won't read it if you just create it.
            3rd. Did you try putting the CSS code in style.css?
            You're right, It would have helped if I'd stated that I'm using the Thesis theme. This has a custom file editor which by default provides access to custom.css and a specific custom_functions.php file.

            I've just looked in style.css in the corresponding Thesis folder and it warns against editing it:

            "...WARNING: DO NOT EDIT THIS FILE. If you wish to make custom stylistic changes to your theme, use the
            custom.css template to define custom styles... "

            However, as a debug step I'll make a temporary change to see if it works.

            Thank you,

            Dave
            {{ DiscussionBoard.errors[5272849].message }}
  • Profile picture of the author engecars
    Try JShortCodes. It's free and works fine.
    Search for "jshortcodes" on Google
    {{ DiscussionBoard.errors[5272563].message }}
  • Profile picture of the author Istvan Horvath
    Another "wrong"... if you bought a theme then those who cashed in should provide you with support - and premium theme buyers should not "abuse" the nice folks in this subforum with their questions

    Nothing wrong asking "web design" questions, including WP themes, but most premium (read: paid) themes have their own support forum or ticket system. Use them because it's their obligation to answer your support questions.

    Whichever license you own you have "Access to members-only Answers and Forums".
    Signature

    {{ DiscussionBoard.errors[5273077].message }}
    • Profile picture of the author DaveC2
      Originally Posted by Istvan Horvath View Post

      Another "wrong"... if you bought a theme then those who cashed in should provide you with support - and premium theme buyers should not "abuse" the nice folks in this subforum with their questions

      Nothing wrong asking "web design" questions, including WP themes, but most premium (read: paid) themes have their own support forum or ticket system. Use them because it's their obligation to answer your support questions.

      Whichever license you own you have "Access to members-only Answers and Forums".
      That's a fair point. With hindsight, I should have directed the question at the Thesis forum.
      {{ DiscussionBoard.errors[5273577].message }}
  • Profile picture of the author kokopelli
    Try WordPress › J Shortcodes « WordPress Plugins, like engecars above suggested. Might be easier than trying to hack/edit CSS.

    Happy Holidays!
    Signature
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    {{ DiscussionBoard.errors[5273247].message }}
    • Profile picture of the author DaveC2
      Originally Posted by kokopelli View Post

      Try WordPress › J Shortcodes « WordPress Plugins, like engecars above suggested. Might be easier than trying to hack/edit CSS.

      Happy Holidays!
      Yes I agree. Since engecars helpful suggestion, I've tested this and think I can proceed with it and get some good looking results.

      Thanks to all for your assistance.
      {{ DiscussionBoard.errors[5273629].message }}

Trending Topics