Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Inline [Partial] Comment

Engaged ,
Dec 11, 2017 Dec 11, 2017

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

809
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 12, 2017 Dec 12, 2017

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 he

...
Translate
Community Expert ,
Dec 11, 2017 Dec 11, 2017

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>

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 11, 2017 Dec 11, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 11, 2017 Dec 11, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 11, 2017 Dec 11, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 11, 2017 Dec 11, 2017

Please have a look at https://html.com/tags/comment-tag/

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 11, 2017 Dec 11, 2017

Link is not working, not in web browser, nor in copy/paste into browser.

Could you please summarize content of the linked resource.

jwc

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 11, 2017 Dec 11, 2017

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2017 Dec 12, 2017
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines