Jump to content


Photo

[solved]valadating css


  • Please log in to reply
5 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 29 September 2006 - 03:17 PM

is there anyway i can use css to stop the code from being seen via the valadation on w3c


i have got the following in a texarea to show users the code but when i valadate the page i get errors becouse the code is already within the page so what do i do.

is it possable to show code within a teaxtarea and stop the code getting valadated maybe a css will do it.


---start code----

1.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

2."http://www.w3.org/TR/html4/strict.dtd"> 

3.<html>

4.<head>

5.<title>Hi ya</title>

6.<link rel="stylesheet" type="text/css" href="example2.css>

7.</head>

8.<body>


9.<p class="test">hi there i am <br>reddarrow</p>

10.</body>

11.</html>
-----end code-------

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 September 2006 - 03:22 PM

Are you typing plain html inot the textarea? If you are then this why. You should chnage the html characters into there html equivalents. EG:

< converts to & lt;
> converts to & gt;
& converts $ amp;
Note the examples above should not have a space before the & character. I had do this due to the forum pasing the html.

if you are adding the html in with php then use the htmlspecialchars function:
$myhtmlvar = htmlspecialchars($myhtml);


echo '<textarea ..your html attributes here ...>' . $myhtmlvar . '</textarea>';

This will then prevent the validator from flagging errors.

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 29 September 2006 - 03:28 PM

heres my code within the text area how do i do it dont get it sorry.


<div class="info">

Example 2

</div>

<div class="info_box_two">

<textarea class="info_box_two" >
---start code----

1.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

2."http://www.w3.org/TR/html4/strict.dtd"> 

3.<html>

4.<head>

5.<title>Hi ya</title>

6.<link rel="stylesheet" type="text/css" href="example2.css>

7.</head>

8.<body>


9.<p class="test">hi there i am <br>reddarrow</p>

10.</body>

11.</html>
-----end code-------
</textarea>

</div>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 29 September 2006 - 03:40 PM

is this correct dosent work?

<div class="info">

Example 2

</div>

<div class="info_box_two">

<textarea class="info_box_two" >
---start code----

1.&gt!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

2."http://www.w3.org/TR/html4/strict.dtd"&lt 

3.&gthtml&lt

4.&gthead&lt

5.&gttitle>Hi ya&lt/title&lt

6.&gtlink rel="stylesheet" type="text/css" href="example2.css&lt

7.&gt/head&lt

8.&gtbody&lt


9.&gtp class="test"&lthi there i am <br>reddarrow&gt/p&lt

10.&gt/body&lt

11.&gt/html&lt
-----end code-------
</textarea>

</div>y>


<p class="test">hi there i am <br>reddarrow</p>

</body>

<html>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 September 2006 - 03:49 PM

Like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>example.html</title>
</head>
<body>


Hees my code:<br />
<textarea cols="50" rows="15">
&lt;!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;example.html&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;


Hees my code:
&lt;textarea name=&quot;html&quot;&gt;

&lt;/textarea&gt;

&lt;/body&gt;
&lt;/html&gt;
</textarea>

</body>
</html>


#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 29 September 2006 - 04:35 PM

solved

Thank you so much never used them before ever more study dam!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> 

<html>

<head>

<title>john</title>

<link rel="stylesheet" type="text/css" href="css.css">

</head>

<body>

<p>

<TEXTAREA rows="10" cols="10" class="info_box">

---start code----

1.
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;

2.
&lt;"http://www.w3.org/TR/html4/strict.dtd"&gt; 

3.
&lt;html&gt;

4.
&lt;head&gt;

5.
&lt;title&gt; Hi ya 
&lt;/title&gt;

6.
&lt;link rel="stylesheet" type="text/css" href="example2.css"&gt;


7.
&lt;/head&gt;

8.
&lt;body&gt;


9.
&lt; class="test">hi there i am br reddarrow p&gt;

10.
&lt;/body&gt;

11.
&lt;/html&gt;
-----end code-------
</textarea>


</body></html>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users