Auto blank spacer program or application - tabs

Well, I recenely made some work on PHP and HTML, and I did not use the TAB thing to make blank spaces which make the code more readable and organized, and now it pisses me off. Anyone knows an effective way or any program where you can put your HTML or PHP and it makes all these spaces for you, making the code more organized? Thanks in advance!

If you use a specific editor, some have "Beautify" features that will auto-tab your source.
In the mean time, you can try this: http://www.beautifyphp.com/

Related

Firefox HTML inspector: how to copy single HTML tag?

I have a website and need to transport a form to another website. I however only need certain tags not the whole form block with all it's tables and divs.
When selecting a html-tag in inspector, I can copy inner HTML, outer HTML or CSS styles but how can I just copy that very exact tag I selected without it's child nodes, just the selected line in HTML code?
I ask this because the HTML is minified and I can't just select and copy a tag in source. Same when I chose "copy outer HTML" I get the whole HTML subtree minified, means everything in one line.
How can I quickly search and copy certain tags from the three without grabbing everything in the branch?
Edit: People, thanks for all your suggestions but please note that I wrote about a MINIFIED HTML page I have here.
Just open Debugger near Inspector
Then find page file... then copy with any select range as you want
UPDATE
if it minify click here
If I understood what you want try this
Since your question seems unsolved yet, let me come up with a creative approach I use for similar tasks from time to time:
(1) Creative solution: Page manipulation
If you don't have a javascript framework of your choice (e.g. jQuery) on that page, add it using a browser-extension that adds it when page has loaded.
Then you write a bit of javascript code that removes unwanted child elements of the desired parents in a loop or so. That sounds like lots of work but since you asked this question I assume you need dozens if not hundreds of elements so it might be worth taking the time to write such loop(s).
When the code you injected processed the page and removed everything you don't want, you can then copy the code like mentioned by others here.
(2) Alternative solution: Beautify the code beforhand
If the given solution(s) don't work for you, one could try to beautify the code by copying the source to a webpage that auto-indends html/js code. You could then optionally save it into a html-file and approach that one again like mentioned here before.
Sidenote
If either this idea is too much work or you need this frequently you are probably approaching this on the wrong side. When working on frontend (only) you are always limited to what you have. If you could approach from the backend you could then build from the data/information whatever you need. If you could provide a bit more information about why you need this and how much code you are talking about one could maybe come up with a more sustainable solution!

HTML/CSS - is is possible to have a html website with multiple pages - but only one menu (indentical) that can be called?

To start off with I can only use HTML and/or CSS. I do not have the capacity to use PHP or JavaScript?
I have researched an iFrame, but I'm not sure if it is possible to have a dropdown menu with an iFrame?
There's a very old-hat way of doing this called framesets, beware this is very old, doesn't look great and I'm not sure if it'll work well with dropdown menus e.t.c.
http://www.w3schools.com/tags/tag_frameset.asp has more on it.
Other than that the only thing I can think of is using PHP includes (which in you mentioned you don't have the capacity for) although I can go into detail about using PHP includes if need be.
Alternatively just repeating the menu code in each html page is the only other option as far as I know.
I personlally don't know a way which is just done with a HTML and CSS. But there is an easy way with PHP.
You make a file (nav.php) where you put your navigation stuff into it.
(Don't forget the php tags):
Now you can include the file in any HTML Document:
<?php include_once "filePath"; ?>
With just html&css, I only know copy&pasting. But with your wording, it sounds like you want just one menu like menu.html and linking it onto the multiple pages where you if you were to change the menu, you only need to change it in one section and don't need to copy and paste the rest. Since you want 1 single menu and link it to the multiple pages, I suggest the php way as Lorenz mentioned.
http://www.w3schools.com/php/php_includes.asp
...or another way I saw someone else do it is somewhere in this video by DevTips:
https://www.youtube.com/watch?v=nZoUA-98fL4
its something like {% filename %} but idk what lang. or whatever that's suppose to be. He just made his code look so much messier to me that I didn't bother looking into it.

Can I have template parts with a straight HTML/CSS website?

I am trying to figure out if it is even possible to somehow implement 'template sections' with a straight html/css website. I use template parts all the time when building wordpress themes, but not sure if there is a way to implement a template section w/out php.
Can anyone offer some advice on this? Is this even possible?
Thanks in advance.
You can technically have "template" parts by copying and pasting the code from one page to another. So I guess that isn't what you would want to do.
So you are correct, in that you would need something like PHP for this. To set up some basic PHP is not that hard. It really will save a lot of needless code and time, by at least using PHP for your header and footer, if they will be the same on all pages.

adding spelling suggestion on HTML page

I am new to web development and just trying to add spelling suggestion to a textarea. I really don't know what I am going to need for this, need to write the code myself or use a third party library etc. Can someone suggest me how to add this functionality to a simple HTML page containing a textarea. I want when I write a misspelled word in text area, some suggestions matching that word should appear in dropdown.
Well autocorrect in the web page can be achieved by JavaScript for sure.
There are some nice frameworks for this, probably you could see this:
https://github.com/sanisoft/jQuery-auto-correct
For only spellchecking (despite built-in browser checking):
http://www.javascriptspellcheck.com/JQuery_SpellCheck_Plugin

How to repeat a menu without using iFrames or PHP in simple HTML/CSS or XML?

sorry for this ultimately newb question. I want to create a menu and not have to repeat the code of the menu on every single web page. I have done this with iframes in the past, but I know they aren't recommended. I have a pretty decent knowledge of HTML & CSS but I feel like I am missing something big here.
I am also not looking for the PHP solution which I believe is represented by:
<?php include("navigation.html"); ?>
Is there a good tutorial I can follow? I've heard this can be done with XML but I haven't been able to find what I am looking for exactly, and don't have any knowledge with it in the past.
In what I think is a related problem, I want to be able to place my google analytics code on just my index page and have it reference the entire website of pages, not just the index. Again, what am I missing here? Do I need to be using a content management system of some sort to pull off this slightly dynamic task? I don't think so...
Thanks for your help and please let me know if I can clarify my question any better!
Why don't you want to use PHP? It can be done with JavaScript (using AJAX), but you need to provide search engines with a way to crawl your site if you go that route.
Using includes in PHP to achieve this is simple and requires extremely little knowledge. Much easier and more efficient than doing it with JS. Also, I don't see how XML would be of any help here unless you read it in with JS (in which you'd have the same issue mentioned above.)
Use server side includes as mentioned already. They are support by pretty much all major webservers so php is not even required.
Check out the following articles:
http://en.wikipedia.org/wiki/Server_Side_Includes
http://httpd.apache.org/docs/1.3/howto/ssi.html (from apache, note no php needed)
http://www.boutell.com/newfaq/creating/include.html
Good Luck
I'm not really sure what options you have other than a .php include. I'm not sure of why you would be avoiding PHP unless the server didn't support it, as it's very simple to do an include (you really don't even need to know PHP to do this except for the include statement).
For your analytics code, you could put this in a .js file and just include it on every page:
<script type="text/javascript" src="analytics.js"></script>
Hope this was at least slightly helpful.
How about javascript? You could write a Javascript file that is included on each page that you wish to display the menu. The javascript could read an XML that contains your menu items and generates HTML to display the menu.
Parse and XML document with JS
http://www.w3schools.com/Xml/xml_parser.asp
jQuery menu solutions
http://speckyboy.com/2010/12/01/15-super-simple-jquery-menu-and-navigation-plugins/