Divs in text area

Discussion in 'HTML & Website Design' started by Hobbit2, Feb 20, 2007.

  1. #1
    I have a MySpace site. I'm starting to make DIV layouts, but when I put the code in a textarea, the div's come out in the page. Does anyone know how to not make them appear in the page? I just want them in the textarea so people can copy paste them into their profile.

    EDIT: This is only a problem in IE. So if you have a solution, make sure it works on all browsers. Thanks.
     
    Hobbit2, Feb 20, 2007 IP
  2. unitedrokz

    unitedrokz Peon

    Messages:
    86
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    do you have some sample code of what you are doing at the moment so we can assess?
     
    unitedrokz, Feb 20, 2007 IP
  3. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #3
    Try something like this:
    <textarea name="textarea" rows="5" cols="50">&lt;div&gt;some text&lt;/div&gt;</textarea>
    Code (markup):
     
    Clive, Feb 20, 2007 IP
  4. Hobbit2

    Hobbit2 Active Member

    Messages:
    720
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Hobbit2, Feb 20, 2007 IP
  5. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #5
    You probably need something like this:
    <textarea cols="100" rows="100">!!!!!!!!! Place this in about me !!!!!!!!!
    
    &lt;div class="frm1"&gt;
    	&lt;table style="border: 0px none; background:"&gt;
    		&lt;tr style="border: 0px none; background:"&gt;
    			&lt;td style="color: white; border: 0px none; background:"&gt;
    			&lt;table style="height: 0px; border: 0px none; padding: 0px; background:"&gt;
    				&lt;tr style="border: 0px none; background:"&gt;
    					&lt;td style="height: 0px; color: white; border: 0px none; padding: 0px; background:"&gt;
    					&lt;table style="height: 0px; border: 0px none; padding: 0px; background:"&gt;
    						&lt;tr style="border: 0px none; background:"&gt;
    							&lt;td style="visibility: hidden; height: 0px; color: white; border: 0px none; padding: 0px; background:"&gt;
    							&lt;/td&gt;
    						&lt;/tr&gt;
    					&lt;/table&gt;
    					&lt;/td&gt;
    				&lt;/tr&gt;
    			&lt;/table&gt;
    			&lt;/td&gt;
    		&lt;/tr&gt;
    	&lt;/table&gt;
    	&lt;p&gt;&nbsp;&lt;/p&gt;
    	&lt;p&gt;&nbsp;&lt;/div&gt;
    &lt;div style="position: absolute; left: 261px; top: 131px; width: 502px; height: 480px; overflow: auto; visibility: visible; font-family: verdana; color: 000000; font-size: 9px; background-image: url('http://img50.imageshack.us/img50/6100/underoathwq8.jpg')" align="center"&gt;
    	&lt;div style="position: absolute; left: 313px; top: 27px; width: 154px; height: 342px; overflow: auto; visibility: visible; font-family: verdana; color: 000000; font-size: 9px; background-color: transparent"&gt;
    		&lt;font face="MS Sans Serif" color="#FFFFFF"&gt;
    		&lt;a href="http://collect.myspace.com/index.cfm?fuseaction=invite.addfriend_verify&friendID=38020399"&gt;
    		&lt;font color="#FFFFFF"&gt;add&lt;/font&gt;&lt;/a&gt;&lt;br&gt;
    		&lt;font color="#FFFFFF"&gt;
    		&lt;a href="http://mail.myspace.com/index.cfm?fuseaction=mail.message&friendID=38020399"&gt;
    message&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="MS Sans Serif"&gt;&lt;br&gt;
    		&lt;/font&gt;
    		&lt;a href="http://www.myspace.com/index.cfm?fuseaction=block.blockUser&userID=91874776&hash=MIGvBgorBgEEAYI3WAPaoIGgMIGdBgorBgEEAYI3WAMBoIGOMIGLAgMCAAECAmYDAgIAwAQIGXHD4JH0THAEECf6D+oY0hC+tgQlI6bv/3oEYDsnaItQbGT3nKk65zCqQzNE/A4uy/0op6EBDVR/zWpjxQJuqzwuCDY"&gt;
    		block&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;form method="post" action="http://comments.myspace.com/index.cfm?fuseaction=user.ConfirmComment"&gt;
    			&lt;p&gt;comment me or die!&lt;br&gt;
    			&lt;textarea name="f_comments" class="Skem9box" rows="3" cols="16"&gt;&lt;/textarea&gt;&lt;br&gt;
    			&lt;input type="submit" value="Post" class="Skem9sub"&gt;&lt;/font&gt;&lt;/p&gt;
    			&lt;input name="friendID" value="38020399" type="hidden"&gt;&lt;/font&gt;
    		&lt;/form&gt;
    		&lt;p&gt;Hi, welcome to the official mydiv.com&lt;br&gt;
    		MySpace. Visit &lt;/font&gt; &lt;a href="http://www.mydiv.com"&gt;
    		www.mydiv.com&lt;/font&gt;&lt;/a&gt; for&lt;br&gt;
    		layouts like this one. There's a wide variety&lt;br&gt;
    		of these layouts, all for free! What &lt;br&gt;
    		inspires me to make more? The fact&lt;br&gt;
    		that you guys will spread the word&lt;br&gt;
    		about my site :) That's it.&lt;br&gt;
    		&nbsp;&lt;/font&gt;&lt;/div&gt;
    	&lt;div style="position: absolute; left: 19px; top: 22px; width: 184px; height: 135px; overflow: auto; visibility: visible; font-family: verdana; color: 000000; font-size: 9px; background-color: transparent"&gt;
    &lt;br&gt;
    		MyDiv.com Official MySpace&lt;br&gt;
    		&lt;/font&gt;
    		&lt;a id="ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&friendID=91874776&MyToken=ba699af3-3895-44a0-a62b-4422bc64b836"&gt;
    		&lt;font color="#FFFFFF"&gt;
    		&lt;a id="ctl00_Main_ctl00_UserBasicInformation1_hlDefaultImage" href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&friendID=38020399&MyToken=ba699af3-3895-44a0-a62b-4422bc64b836"&gt;
    		&lt;img src="http://x.myspace.com/images/no_pic.gif" style="border-width: 0px;"&gt;&lt;/a&gt;&lt;/font&gt;&lt;/a&gt;&lt;font color="#FFFFFF"&gt;&lt;br&gt;
    		&lt;/font&gt;
    		&lt;font face="MS Sans Serif"&gt;
    		&lt;a href="http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&friendID=91874776&MyToken=ba699af3-3895-44a0-a62b-4422bc64b836"&gt;
    		view more pics&lt;/font&gt;&lt;/a&gt;&lt;br&gt;
    &nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="byebye"&gt;
    	&lt;table&gt;
    		&lt;tr&gt;
    			&lt;td&gt;
    			&lt;table&gt;
    				&lt;tr&gt;
    					&lt;td&gt;&lt;/td&gt;
    				&lt;/tr&gt;
    			&lt;/table&gt;
    			&lt;/td&gt;
    		&lt;/tr&gt;
    	&lt;/table&gt;
    &lt;/div&gt;
    
    &lt;font color="#FFFFFF"&gt;
    
    &lt;/body&gt;
    
    &lt;/font&gt;
    
    &lt;/html&gt;
    
    
    
    
    
    
    
    
    
    
    
    !!!!! PUT THIS IN WHO I'D LIKE TO MEET !!!!!!
    
    
    
    
    
    
    
    
    
    &lt;Style type="text/css"&gt; 
    table, tr, td {background:transparent;} table table table table, table.contactTable {display:none;} td.text table{visibility:hidden;}.nametext, .whitetext12, .orangetext15 {display:none;}div table td font {display: none;} td.text table table{display:inline;visibility:visible;}table, td{border-width:0px;}
    
    .div1 { position:absolute; left:50%; top:200px; width:800px; z-index:1; margin-left:-400px; padding:0px; border:0px; background-color:transparent; height:2000px;}
    
    .byebye
    {
       display:none;
    }
    
    td.text td.text table table table, td.text td.text table br, td.text td.text table .orangetext15, td.text td.text .redlink, td.text td.text span.btext {display:none;}
    td.text td.text table {background-color:transparent;}
    td.text td.text table td, td.text td.text table {height:0;padding:0;border:0;}
    td.text td.text table table td {padding:3;}
    td.text td.text table table br {display:inline;}
     &lt;/Style&gt;
    
    
    &lt;div class="byebye"&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;
    
    
    
    
    
    
    
    !!!!! PUT THIS IN INTERESTS !!!!!!
    
    
    
    &lt;Style type="text/css"&gt; body{ background-color:312d27; background-image:url(http://img161.imageshack.us/img161/428/underoathsidehl7.jpg); background-position:Top Left; background-attachment:fixed; background-repeat:no-repeat; } Table, Td{ background-color:transparent; } body, div, p, strong, td, .text, .blacktext10, .blacktext12, a.searchlinkSmall, a.searchlinkSmall:link, a.searchlinkSmall:visited{ color:FFFFFF; font-size:8pt; font-weight:normal; font-style:normal; font-family:Georgia, verdana, arial, sans-serif; } a, a:link, a:visited, a.navbar, a.navbar:link, a.navbar:visited, a.man, a.man:link, a.man:visited, a.redlink, a.redlink:visited{ color:647289; font-size:8pt; font-weight:normal; font-style:normal; font-family:Georgia, verdana, arial, sans-serif; } a:hover, a:active, a.navbar:hover, a.navbar:active, a.man:hover, a.man:active, a.searchlinkSmall:hover, a.searchlinkSmall:active, a.redlink:hover, a.redlink:hover{ font-size:10pt; font-weight:normal; font-style:normal; font-family:Georgia, verdana, arial, sans-serif; } &lt;/Style&gt;</textarea>
    Code (markup):
     
    Clive, Feb 20, 2007 IP
  6. Hobbit2

    Hobbit2 Active Member

    Messages:
    720
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Hobbit2, Feb 22, 2007 IP
  7. dollcharm

    dollcharm Peon

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    jemjabella.co.uk/stuff/convert.php - converts to 'friendly' html. Div tags shouldn't show up if they're in textarea codes, but try using the converter (it does what Clive did to your code) and see if that helps.
     
    dollcharm, Feb 23, 2007 IP
  8. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #8
    The formula is pretty simple,
    Forthe code that goes inside the textarea, you need to use a Find & Replace tool to change all instances of "<" to "&lt;" and ">" to "&gt;".
     
    Clive, Feb 23, 2007 IP