Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJoshua Pristavec
Front End Web Development Techdegree Student 5,419 PointsHow do i get my text editor (Brackets) to ignore a closing tag?
I'm trying to wrap the three images, headings, and paragraphs in my responsive project with a div. However when i do and unrelated div closes itself prematurely with the closing tag of the div i'm trying to create. How can i get it to over look this div since its not its actual closing tag?
Joshua Pristavec
Front End Web Development Techdegree Student 5,419 Points@john larson now sure if i described my situation good enough. What im saying is there is already a div inside the area of where im putting a new div. Well that new div is closing itself with the first divs closing tag.
john larson
16,594 PointsSorry, I don't get it. Wish I could help. Can you post the code, and what you are trying to do?
Rees Hinton
12,690 PointsUntil you close the new div, Brackets will assume the next div closing tag is for your new div. You may want to close the div yourself and then enter your content into the div, hope that answers your question.
2 Answers
Zachary Betz
10,413 PointsHi Joshua, try this:
Using the Brackets menu, navigate to >> "Debug" >> "Open Preferences File"
In the "brackets.json" file, add the below json, then save the file.
"closeTags": {
"whenOpening": false
}
This will disable tags from automatically closing after they are opened. Just for reference, my entire "brackets.json" file looks like the below:
{
"fonts.fontSize": "14px",
"fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"livedev.multibrowser": false,
"closeTags": {
"whenOpening": false
}
}
John Weber
6,273 PointsIf I understand you correctly, you are trying to nest a <div> within another <div> and you would like to have the first ignore the second's closing tag, correct?
Close the first tag before the second tag, create a third tag and close that one when you are finished. Then, assign a class attribute for the first and the third tags so you can apply the same style to each of them, as if they were the same <div>
john larson
16,594 Pointsjohn larson
16,594 PointsCan you let it close itself, cut it and then paste it where you want it?