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

Inline [Partial] Comment

Engaged ,
Dec 11, 2017 Dec 11, 2017

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

Views

528

Translate

Translate

Report

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

...

Votes

Translate

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

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>

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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