• Hello,

    Could someone help me with a bit of HTML Code. I’m new at this, so I got no idea how it works. I’ve already tried to search around and use codes snippets found on the net but they never work fully.

    Here’s what I need:
    A box with some text. The box needs to be 100×63 px. It has to be filled with a color. Some of the text needs to be a specific color + size.
    I’d really appreciate if someone could help me out here.

    /Andreas

Viewing 9 replies - 1 through 9 (of 9 total)
  • You’ll need HTML and CSS – CSS can go in a child theme or custom CSS option or plugin:

    HTML:

    <div class="mybox">
       PUT YOUR CONTENT IN HERE
    </div>

    CSS:

    .mybox {
       width: 100px;
       height: 63px;
       background-color: blue;
       color: red;
       font-size: 10px;
    }

    This may be helpful too:

    http://www.w3schools.com/css/css_boxmodel.asp

    Thread Starter -Andreas

    (@-andreas)

    Yeah this works, thanks.
    Two problems though. How do I make the text centered in the box, and why do my box skip down onto the next line? Anyway that I can force it to stay after a picture I’ve included like this:

    <img src="http://www.myside.com/wp-content/uploads/2015/01/random.png" alt="" /><div class="mybox"><font size="5" color="#ffffff">test</font>/test2</div>

    Add to the CSS:

    text-align: center;

    Can’t see the image – see if adding this to CSS does what you want:

    clear: none;

    Thread Starter -Andreas

    (@-andreas)

    The text is now centered horizontally, but I need it to be vertically as well if that’s possible. So it completely in the center.
    Also clear: none; didn’t help. Anywhere I can send you a private login?

    No sorry, we only offer help here and please don’t give login info to anyone you don’t know! Just a bad idea security wise.

    See:

    http://www.w3schools.com/cssref/pr_pos_vertical-align.asp

    Thread Starter -Andreas

    (@-andreas)

    Oh I wasn’t going to give adminuser, just a regular as the site is locked for everyone else at the moment.

    Anyway, this code doesn’t seem to affect anything for some reason.

    vertical-align:-25px;

    Because that’s not a proper value for that CSS attribute – read this again:

    http://www.w3schools.com/cssref/pr_pos_vertical-align.asp

    (Try “middle”)

    Thread Starter -Andreas

    (@-andreas)

    That’s not working I’m afraid.

    Can you post a link to your site where this is – there’s really no way to help much more without seeing it.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘HTML Text Code’ is closed to new replies.