The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> what is wrong with html
jassie
post Dec 19 2018, 11:18 AM
Post #1





Group: Members
Posts: 4
Joined: 20-September 14
Member No.: 21,574



I am wondering in a web page if the following html is valid for the span tags? If not would you show me what I can do to make the html valid?
1. Basically there is a main span tag of <
span style="font-size: 13px;font-family: arial,sans-serif; color: black;">
and a final span label.
2, Are the embedded span tags correct?
Here is an example of some html that is send to an asp.net web page:
<span style="font-size: 13px;font-family: arial,sans-serif; color: black;"><p>&nbsp;</p> <p></p> <p></p> <p> </p><br /><br />&amp;CUR_DATE.EVAL</p><br /><br /><br /><br /><br /><br /><p> </p> <p>To the &amp;PAR_NAME.EVAL of &amp;STU_FNAME.EVAL &amp;STU_LNAME.EVAL<br /> <span id="ADDR_BEG"></span>&amp;PAR_ADDR.EVAL<br /><span id="ADDR_NEXT"></span>&amp;PAR_CITY.EVAL, &amp;PAR_STATE.EVAL &amp;PAR_ZIP.EVAL<br /><span id="ADDR_END"></span> <br /><br /><br /> <br /> <br /> Dear &amp;PAR_NAME.EVAL and &amp;STU_FNAME.EVAL &amp;STU_LNAME.EVAL:<br /> <br /> <br />
Sincerely,<br /> <br /> <br /> &amp;SPA_NAME.EVAL<br /> &amp;SPA_EMAIL.EVAL<br /> School Support Liaison/ Attendance Designee<br /> &amp;SCHOOLNAME.EVAL<br /> <p> &amp;PERMNUM</p></span>

This post has been edited by jassie: Dec 19 2018, 11:19 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 19 2018, 12:25 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(jassie @ Dec 19 2018, 05:18 PM) *

I am wondering in a web page if the following html is valid for the span tags? If not would you show me what I can do to make the html valid?

No, you can't put a P element inside a SPAN. Use say a DIV element instead of the main SPAN.

QUOTE
</p><br /><br />&amp;CUR_DATE.EVAL</p>

This part is also invalid, there's a stray end P tag. The validator at http://validator.w3.org/ can point out such errors (even though the error reports are sometimes cryptic).

It's also best to avoid BR elements for text formatting. Either use a bullet list (UL and LI elements) or possibly P elements with CSS margin/padding/width.

It's also unpractical to use inline styles (the STYLE attribute), put the CSS in a stylesheet instead.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jassie
post Dec 19 2018, 07:08 PM
Post #3





Group: Members
Posts: 4
Joined: 20-September 14
Member No.: 21,574



The part where the span tag is at the beginning is intended for the font to be the same size in the entire html. Also there is no css on the web page. would you show me how to make the font all the same size?

Your comment ,"It's also best to avoid BR elements for text formatting. Either use a bullet list (UL and LI elements) or possibly P elements with CSS margin/padding/width." There is no css. I basically want blank lines. should I use p tags or what do you suggest?

Your comment. "It's also unpractical to use inline styles (the STYLE attribute). Can you tell me what inline styles are?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 19 2018, 07:36 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



There is a lot of CSS. Everything you have as value of style attributes is CSS. smile.gif

Only, there is little point of using CSS if you put everything in style attributes. Reserve that for quick changes. If all you want is the same font for the whole page you need neither SPAN nor DIV.

Take this.

CODE
body   { font-size: 13px; font-family: arial, sans-serif }


It can also be written with shorthand, like this.

CODE
body   { font: 13px Arial, sans-serif }


Now you have two options. Either put that line in a style block placed within HEAD. Like so.

HTML
<head>

<title>Your title</title>

<style type="text/css">
body { font: 13px Arial, sans-serif }
</style>

</head>


Or put the line in an otherwise totally empty document and save it as whatever.css .

Then you link to it in HEAD like this (if the CSS file is in the same folder as the HTML).

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


The advantage of a linked style sheet is that it can be used with all your pages. You could even use it with several sites, if you want. If you want to change something about the font it's enough to edit that single line. But for testing and learning a style block in HEAD may be more handy.

You should read the CSS tutorial. It's CSS1 only, but that doesn't matter because that's what you want to use to start with and you can move on to more advanced things later. It's short and easy to follow.
http://htmlhelp.com/reference/css/

I know you are new. But it's a lot easier to learn if you get it right from the beginning. Relearning and rewriting is no fun. happy.gif
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 20 2018, 05:24 AM
Post #5


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(jassie @ Dec 20 2018, 01:08 AM) *

I basically want blank lines. should I use p tags or what do you suggest?

Exactly what HTML to use depends on the semantics of the text content. This looks like an email/letter template, and for the addresses you are indeed encouraged to use (a single) BR element for line breaks: https://www.w3.org/TR/html/textlevel-semant...l#elementdef-br but for separating the text paragraphs you should use P (and CSS to increase the vertical margin between each P element).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 20 2018, 06:42 AM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



An email template? Forget what I said about linked style sheets in that case. Inline CSS is probably good in that context.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 20 2018, 03:24 PM
Post #7


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Dec 20 2018, 12:42 PM) *

An email template? Forget what I said about linked style sheets in that case. Inline CSS is probably good in that context.

I'll let the OP answer that, but:

QUOTE(jassie @ Dec 19 2018, 05:18 PM) *

Here is an example of some html that is sent to an asp.net web page:

Also there are ASP variables(?) like these:

QUOTE
CODE
&amp;CUR_DATE.EVAL

suggesting that a web server (rather than an email) is used. unsure.gif



User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 20 2018, 07:54 PM
Post #8


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



It was you that suggested an email TEMPLATE and I bought it. tongue.gif

But a template on the server, obviously. If so, the HTML would still be in the email.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 01:26 PM