www.webdeveloper.com
Results 1 to 8 of 8

Thread: Align

  1. #1
    Join Date
    Mar 2013
    Posts
    23

    Align

    Hi

    I have sevral errors in my html file, all due to

    Line 139, Column 108: The align attribute on the img element is obsolete. Use CSS instead.…th: 135px"> <IMG SRC="flags/bh.png" ALIGN="left" alt="Bahrain">Bahrain</BUTTON>

    The line looks like this

    <BUTTON TYPE="submit" style= "height:30px;width: 135px"> <IMG SRC="flags/bh.png" ALIGN="left" alt="Bahrain">Bahrain</BUTTON>

    I guess that I have to add something to the css. but how do I rewrite the html line, please?

    Thank you

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,174
    So, change the "align" attribute to a "style" attribute, and choose the desired styling (e.g. "text-align:left;", perhaps?).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Mar 2013
    Posts
    23
    That's where I am stuck. I am ashamed to say that I am lost and not sure how to write the whole line, Spent a few hours trying and including also a link until I gave up. can you help?

  4. #4
    Join Date
    Mar 2013
    Posts
    23
    Could it be something like this? And what about the link?

    <BUTTON TYPE="submit" style= "height:30px;width: 135px"> <IMG SRC="flags/bh.png" alt="Bahrain" style="align:left;">Bahrain</BUTTON>

  5. #5
    Join Date
    Mar 2013
    Posts
    23
    sorry NogDog, we crossed messages.

    i tried text-align:left
    and <BUTTON TYPE="submit" style= "height:30px;width: 135px"> <IMG SRC="flags/id.png" alt="Indonesia style="float:left">Indonesia</BUTTON>

    also I don't know how to insert the link to another paga within this code

  6. #6
    Join Date
    Mar 2013
    Posts
    23
    Sorry. I saw rthe mistake. It works with float.

    What about the link for the button?

  7. #7
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,174
    Probably the simplest and most portable solution is to wrap the button in a form tag that has as its action the URL you want to link to.
    HTML Code:
    <form action="http://example.com/page"><!-- button stuff here --></form>
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  8. #8
    Join Date
    Mar 2013
    Posts
    23
    Hi thanks

    The link works when you press the button, but... it throws the styling upside down. I wanted to post a screen capture but apparently you cannot add attachments.

    I have four buttons inline in each row. When I add this code in just one of them the line it is in spçits in three as if the new code is taking space.

    Any ideas?

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles