Copy link to clipboard
Copied
Suppose I would like the server to ignore only a portion of a line of html. What are the symbols for that, if any? I seem to recall past use of those, but would prefer not to embark on a trial-and-error experimentation to try to recover them.
With thanks in advance,
and best holiday wishes,
jwc
Copy link to clipboard
Copied
When you say a partial line of HTML, make sure you're not creating code errors for yourself.
<h4>Heading 4 </h4>
<!--html commented out code goes inside here-->
<p>This is a sentence in a paragraph</p>
Copy link to clipboard
Copied
I take this to mean that it is not possible to comment-out a part of a line(?).
IOW, I thought that there were alternative start/stop symbols for commenting-out a part of a line of html.
Best,
jwc
Copy link to clipboard
Copied
I typically use php comments if I'm hiding something from the browser...
<?php /* your code here */ ?>
On a .php page, the server will remove the entire comment from your code.
Anyone looking at the page source sees only what the browser sees, no <!-- start header here --> or <!-- end footer --> mixed into your final html.
Copy link to clipboard
Copied
Right, but please see my reply to Nancy. I wondered if there was a character-set that would allow the server to ignore just a portion of a line of html, as in, for example:
The quick brown fox jumped <<under>>over the lazy dog’s back,
where all content between << . . . >> would be ignored.
Is there an ‘ignore' character set, that one can use ‘inline’, in place of ‘<<' . . . '>>’ above?
Best,
jwc
Copy link to clipboard
Copied
Please have a look at https://html.com/tags/comment-tag/
Copy link to clipboard
Copied
Link is not working, not in web browser, nor in copy/paste into browser.
Could you please summarize content of the linked resource.
jwc
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Jack wrote
Right, but please see my reply to Nancy. I wondered if there was a character-set that would allow the server to ignore just a portion of a line of html, as in, for example:
The quick brown fox jumped <<under>>over the lazy dog’s back,
where all content between << . . . >> would be ignored.
Is there an ‘ignore' character set, that one can use ‘inline’, in place of ‘<<' . . . '>>’ above?Best,
jwc
Either of the options I mention will work, with html comments...
<div>
<p>Some text goes here<!-- this is commented out--> and the rest goes here</p>
</div>
<!-- <div>this div is hidden</div> -->
(which displays exactly as above for someone viewing the source) or with php comments...
<div>
<p>Some text goes here<?php /* this is commented out */ ?> and the rest goes here</p>
</div>
<?php /* <div>this div is hidden</div> */ ?>
Which I like better, because it displays as...
<div>
<p>Some text goes here and the rest goes here</p>
...when the source is viewed. Nobody can see what code, portion of a line, block of text or notation you're using by viewing your source, php comments never make it to the viewer's browser.