Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] How to reset div alignment?

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #196813
    knowledgenotebook
    Participant

    Hi,

    I have a small block of text (a few words) for one div and then another div that has a large block of text. I want text in both divs to be centered but the following code does not work out this way.

    P1: How to fix it?

    Please see code here:
    http://codepen.io/knowledgenotebook/pen/zxaxGo

    P2: I’d like to have the “Back” url function inside the to be bottom-right aligned with the DIV, how?

    P3: Currently the table border color is solid blue, how to do sky blue, which looks smooth.

    Thank you very much.

    #196831
    Paulie_D
    Member

    Couple of things…it’s not really a good idea to use numbers to identify elements.

    <div id="36">
    

    I think you’re allowed to do that under HTML5 but older browsers may not be so forgiving.

    Also, if you would extract all that inline CSS to a proper stylesheet it might make it easier to see what is going on.

    #196832
    Senff
    Participant

    Your inline styles are overriding your CSS styles:

    <table style="border:1.5px solid blue;  margin-left:8%; margin-right:8%; width:500;height:300"">
    

    Plus there are a few things wrong with that (width and height have no “px” or “%” value, double quotes).

    #196833
    Paulie_D
    Member

    Also it’s difficult to understand why a table is being used for this layout based on the small sample but, as we all know, using tables for general layout is not an optimal solution.

    #196838
    Paulie_D
    Member

    There’s still a lot of inline CSS.

    Also the font element is no longer valid.

    If you want “skyblue” just use it

    border:1.5px solid skyblue; 
    

    ..as for centering the text

    div {
    text-align: center;
    }
    

    Still wondering about that table layout though…it’s really hard to figure out what you are trying to do.

    Perhaps a design image of the expect result would explain things?

    #196841
    Paulie_D
    Member

    A tables really isn’t the way to go here since it looks like you’re trying a transform.

    There are a lot of card flip demos out there…I’d use one of those.

    #196864
    Paulie_D
    Member

    You’d have to build a demo in Codepen for us to look much further.

    #196866
    Paulie_D
    Member

    …and you still have the CSS inline.

    If you don’t extract that to the CSS area as has been asked several times before you make it very hard to look through and help you.

    #196869
    Paulie_D
    Member

    The thing is, we can’t control the content of each card, some of them may be simply copied and pasted from the web, hence, it would embed HTML and CSS code during the copy/paste process.

    That sounds incredibly dangerous and unsecure. You’re asking to get hacked.

    If you want consistency you should be limiting what and how users can add to ‘cards’.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.