Sample structure:
<div>1111111111</div> <!-- First line -->
<div>2222222222</div> <!-- Second line -->
<div>3333333333</div> <!-- Third line -->
It's OK. However, I want to wrap comment for this divs.
Sure, not working like this:
<!--
<div>1111111111</div> <!-- First line -->
<div>2222222222</div> <!-- Second line -->
<div>3333333333</div> <!-- Third line -->
-->
How can I do this?
If you really can't change any comments within the original source, but you can (or so it seems) wrap some lines in the source with something. You could turn the lines into a JavaScript multi line comment like I have done in this jsFiddle.
<script type="text/javascript">
/*
<div>1111111111</div> <!-- First line -->
<div>2222222222</div> <!-- Second line -->
<div>3333333333</div> <!-- Third line -->
*/
</script>
Related
Is there any to comment out a knock out code in HTML, since the ko code is already in default html comment block.
<!-- ko if : isEditable() -->
<!-- Edit Mode -->
<div class="edit">Edit mode</div>
<!-- /ko -->
Can I comment the above section in my html
In our project we tend to use <!-- kocomment if : isEditable() --><!-- /kocomment --> syntax which effectively turns ko statement into a simple html comment (knockout does not care for such comments).
Or you may use shorter additions to ko word. Just make sure to comment out both opening and closing statement, there is also risk that this commented comment will not stand out, unless you have some knockout syntax highlighting.
Just change the ko to anything else!
<!-- koc if : isEditable() --> or <!-- kcomment if : isEditable() --> anything other that ko makes it as a comment.
As knockout looks only for html comments that start with ko, anything other than ko on an html comment will simply be a comment.
Noob question but I want to be able to quickly comment HTML code using keyboard shortcuts in VS code. Problem is I get this:-
<!-- <div class="whatever">
<h1>Hellow World!</h1>
<p>this is code I wrote in HTML</p>
</div> -->
instead of this:-
<!-- <div class="whatever"> -->
<!-- <h1>Hellow World!</h1> -->
<!-- <p>this is code I wrote in HTML</p> -->
<!-- </div> -->
Anyone know a good extension for this in VS Code? Thanks
Julien
See this extension written by me, Toggle Line Comments, that will do what you want.
-- or older answer --
Select through your text - i.e., from some part of the first line to some part of the last line you want separately commented. I.e., highlight your block of html to comment.
Shift-Alt-I will put a cursor at the end of each line.
Ctrl-/ will comment each line separately.
This only seems necessary for html, not js or scss for example.
I suppose if you wanted to reduce keystrokes you could make a macro for steps 2 and 3 combined.
I have called a view within another view
<!-- right area ends -->
</div><!--row marginTR-30px ends-->
</div><!--container marg-top-bnr ends-->
<!-- blog area ends -->
<?php $this->load->view('common/footer'); ?>
<?php $this->common_lib->compared_salon(); ?>
</div><!--body-inner salon-profile ends -->
Top
Here I have rendered my view footer after these element and html comment
<!-- right area ends -->
</div><!--row marginTR-30px ends-->
</div><!--container marg-top-bnr ends-->
<!-- blog area ends -->
But when it's loaded, the entire element available inside the footer view goes to some of its parent element as I'm able to see it with inspect element
Click here to see it in large view
All social icons are horizontally aligned, but due to tag structure change while loading view, its look is totally changed.
Earlier it's running well, I'm unable to find solution. According to me all footer tag element should come after these line, but it's showing before it.
<!-- right area ends -->
</div><!--row marginTR-30px ends-->
</div><!--container marg-top-bnr ends-->
<!-- blog area ends -->
Unfortunately you have not shown any of the HTML associated with your issue.
My educated guess is that your divs are "up the spout". I'd be looking at the actual HTML Source and making sure your pairs are where you expect them to be.
If you "had it working" and now it's not - it's very easy to have this happen (read as - I've done this myself on the odd occassion ).
UPDATE:
So out of all that code you provided, I found
<div class="marginT-30px social clearfix">
</div>
I'm Not sure if 6 x 4 is ever equal to 12! :)
I'd be going over that code with a fine tooth comb. I've no idea what or where marginT-30px and friends are set.
I try to comment out a block of HTML which contains comments, when the time I do so, the commenting terminated at the first comment tag ending. Is there any way to do so? I didn't find it anywhere.
Let see this HTML
<!-- START overview-section -->
<div class="overview gray">
<!-- Title section -->
<div class="row">
</div>
</div>
How to comment it as a whole.
Short of breaking up the pairs of -- inside the comment, you cannot achieve this in HTML.
If you were generating your HTML from some kind of template language, you could use the template language's comment syntax instead.
You can wrap it up in a script tag and use JavaScript's block comments
<script> /***
<!-- START overview-section -->
<div class="overview gray">
<!-- Title section -->
<div class="row">
</div>
</div>
***/ </script>
this can't be done with HTML. It can however be done if it were php
<?php
//<!-- START overview-section -->
//<div class="overview gray">
// <!-- Title section -->
// <div class="row">
// </div>
//</div>
?>
Is there any plugin out there that creates begin, end HTML comments automatically? Like the following.
<!-- begin #page -->
<div id="page">
<!-- begin #header -->
<div id="header">
</div>
<!-- end #header -->
</div>
<!-- end #page -->
I am tired of commenting these out.
You may use this little snippet that I wrote:
<snippet>
<content><![CDATA[
<!-- .${1:className} -->
<div class="${1:className}">
${2}
</div>
<!-- /.${1:className} -->
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>divc</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
and save it in Sublime Text #\Packages\User\divc.sublime-snippet
When you are done, you can use divc+tab to generate the required snippet
Not that i know of but you can create a custom snippet and use it when you like. This will allow you to insert that text without typing it out each time.
For directions check this link:
http://sublimetext.info/docs/en/extensibility/snippets.html
If you just want to comment something out, you can just select the content you want to comment and type ctrl + / and it will do the trick.