Web Analytics Made Easy -
StatCounter Aligning a DIV inside a CLASS - CodingForum

Announcement

Collapse
No announcement yet.

Aligning a DIV inside a CLASS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aligning a DIV inside a CLASS

    Hi

    I'm having trouble aligned my div named #touch inside my class named div.page-name.

    I want it to align to the right but I can't understand why it won't. I've tried float;right; as well but it only moves it to the right slightly.

    This is my HTML:

    Code:
    <div class="page-name">
            <div id="touch">Get in touch!</div>
    
    		<h3 class="fontface">My Portfolio</h3>
    
    </div>
    And my CSS:

    Code:
    div.page-name {
        position:relative;
        width:1000px;
        height:100%;
    	background-color:#CFC;
    	margin-left:auto;
    	margin-right:auto;
    }
    	
    #touch {
    	position:relative;
    	text-align:right;
    }


    If anyone can help it would be appreciated.

  • #2
    Your XHTML code is not well formatted. You have not closed several tags properly. For instance you missed XML end tag slash for empty elements:
    Code:
    <link rel="stylesheet" href="css.css" type="text/css" [COLOR="Blue"]/[/COLOR]>
    <link rel="stylesheet" href="fontface.css" type="text/css" charset="utf-8"[COLOR="Blue"] /[/COLOR]>
    And you have an extra </div> on line 34, i think, which closes nothing. You have several elements with the same id (an id must be unique)...And many other similar errors.

    Validate, first, your document at:
    W3C's easy-to-use markup validation service, based on SGML and XML parsers.
    Last edited by Kor; Sep 8, 2011, 09:16 AM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

    Comment


    • #3
      bummer dude:

      This Page Cannot Be Displayed

      Based on your corporate access policies, this web site ( http://benlambe.com/Website/portfolio.html ) has been blocked because it has been determined by Web Reputation Filters to be a security threat to your computer or the corporate network. This web site has been associated with malware/spyware.

      Threat Type: Othermalware
      Threat Reason: Hosted on IP controlled by a group or individual known to be malicious.

      If you have questions, please contact your corporate network administrator and provide the codes shown below.

      Notification codes: (1, MALWARE, Othermalware, Hosted on IP controlled by a group or individual known to be malicious., BLOCK-MALWARE, 0x0e9e34e8, 1315490934.055, QAAAAQAAAAAAAAAAFP8ACP8AAAD/AAAAAAAAAAAAAAE=, http://benlambe.com/Website/portfolio.html)
      - Firebug is a web developers best friend! - Learn it, Love it, use it!
      - Validate your code! - JQ/JS troubleshooting
      - Using jQuery with Other Libraries - Jslint for Jquery/other JS library users

      Comment


      • #4
        Originally posted by DanInMa View Post
        bummer dude:

        This Page Cannot Be Displayed

        Based on your corporate access policies, this web site ( http://benlambe.com/Website/portfolio.html ) has been blocked because it has been determined by Web Reputation Filters to be a security threat to your computer or the corporate network. This web site has been associated with malware/spyware.

        Threat Type: Othermalware
        Threat Reason: Hosted on IP controlled by a group or individual known to be malicious.

        If you have questions, please contact your corporate network administrator and provide the codes shown below.

        Notification codes: (1, MALWARE, Othermalware, Hosted on IP controlled by a group or individual known to be malicious., BLOCK-MALWARE, 0x0e9e34e8, 1315490934.055, QAAAAQAAAAAAAAAAFP8ACP8AAAD/AAAAAAAAAAAAAAE=, http://benlambe.com/Website/portfolio.html)
        Really? Which browser do you use? I see neither of all these in my browsers: IE6, IE7, IE8, IE9, FF 6, Opera 11, Chrome 13.

        Nor my MSE protection does not complain at all, (it is true that MSE is not quite restrictive...)
        KOR
        Offshore programming
        -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

        Comment


        • #5
          bummer dude:
          I've never seen that, but I'm using a free host at the moment. I'll look into getting a paid package from a reliable company.

          Your XHTML code is not well formatted. You have not closed several tags properly. For instance you missed XML end tag slash for empty elements:
          Code:
          <link rel="stylesheet" href="css.css" type="text/css" />
          <link rel="stylesheet" href="fontface.css" type="text/css" charset="utf-8" />
          And you have an extra </div> on line 34, i think, which closes nothing. You have several elements with the same id (an id must be unique)...And many other similar errors.

          Validate, first, your document at:
          http://validator.w3.org/
          I've fixed that, and I've validated both my xhtml and css.

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎