Jump to content

Ingolme

Moderator
  • Posts

    14,894
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by Ingolme

  1. MDN has a good description of image formats and what they're good for: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#supported_image_formats Personally, I find PNG to be the most reliable format for complex images. While WebP has slightly better compression, it is not as widely supported by browsers, though all the biggest browsers support it. SVG is good for simple shapes, since it is a vector format. It is ideal for icons, logos and similar images.
  2. Oh, I see you were referring to the website account rather than the forum account. I'm afraid I cannot really help, but you can send an e-mail to help@w3schools.com to see if they can resolve your issue.
  3. You could try using break-inside. If the break-inside rule does not work on the <img> tag then it might not be possible to solve this.
  4. There is information about centering containers on this page: https://www.w3schools.com/howto/howto_css_center_website.asp I recommend upgrading from XHTML Transitional to HTML 5. XHTML was phased out ten years ago.
  5. Your account seems to be activated now. It should have told you that the account requires moderator verification. All accounts need to be approved by a moderator.
  6. I am suspicious of this script and the website it is targeted to. What exactly do you need this script for? For now, I will remove links to the site as it looks like advertising.
  7. W3Schools itself is a resource to lean HTML and CSS fast and free. Please read the forum guidelines. Links to resources which are in direct competition with W3Schools are not permitted on the forums.
  8. My first guess is that BlogSpot removes <script> tags from the content of the document. If that is not the cause of the problem, then maybe there is a Javascript error. In most browsers you can see Javascript errors by pressing F12.
  9. At the W3Schools.com forum, most of the users just do web development. Managing operating systems and software is not something most people have experience with. Maybe a site like StackExchange will have somebody who can answer your question. SuperUser.com seems to be a useful site for these kind of questions.
  10. It is impossible to protect HTML code, but I will do what you asked. Here is the above code without password: <html> <head><title>Encryptor</title></head> <body> <div id="thecode" style="display:none"> &lt;script&gt; document.write(unescape("thecode")); &lt;/script&gt; &lt;noscript&gt;JavaScript must be enabled in your browse in order to see protected page.&lt;/noscript&gt; </div> <script> function do_encode() { orig = document.getElementById("as1").value; thecode1 = document.getElementById("thecode").innerHTML; thecode1 = thecode1.replace(/&lt;/g,'<'); thecode1 = thecode1.replace(/&gt;/g,'>'); thecode1 = thecode1.replace(/&amp;/g,'&'); orig1 = thecode1.replace(/thecode/,escape(orig)); document.getElementById("as2").value = orig1; } </script> <b>Enter your HTML code to be encrypted:<br></b> <textarea id="as1" rows="10" cols="50"></textarea><br> <button onclick="do_encode()">Click Here to Encrypt and Password Protect Your HTML</button><br> <br> This is your protected HTML page text. Save this text as an HTML file:<br> <textarea id="as2" rows="10" cols="50"></textarea> </body> </html>
  11. You will need to clarify exactly what you want.
  12. Actually, to remove the password from the generated HTML, just cut out everything and only keep these lines: <script language="JavaScript1.2"> orig = unescape( /* ... ... ... ... */ ); orig1 = orig1.replace(/mmm/g,"\r\n"); document.write(orig1); </script> <noscript>JavaScript must be enabled in your browse in order to see protected page.</noscript>
  13. orig_pass = prompt("Please enter password",""); To remove the password prompt, just replace the above line with whichever fixed value you want. orig_pass = "XYZ"; This code is not very good, the variables aren't properly declared and they're using outdated attributes. If you're intending to hide your source code from people, I will have to warn you that it is impossible. If the browser is able to read the source code then so can anybody.
  14. The position property in CSS determines how the top, right, bottom and left properties behave. When set to "relative", the element gets moved a certain distance from where it started, but the space it was in remains reserved. If the position is set to "absolute" then the element will be positioned from the edges of its nearest positioned container. It's best if you try out the examples in the tutorial page: https://www.w3schools.com/css/css_positioning.asp
  15. For front end development you should learn HTML, CSS and Javascript. If you want to be purely a designer, you don't necessarily need to learn the languages but it helps to know them. I've worked with some designers in the past, they pass their design documents to the developers, so they don't need to write code.
  16. If you know which email address you used, it looks like you can reset your password here: https://profile.w3schools.com/reset-password
  17. I don't know what's in your iframe. What does console.log(allTags) show?
  18. Your querySelector() call is not getting the iframe because the selector is wrong. Also, you should be using contentDocument instead of contentWindow because querySelectorAll() belongs to the Document object.
  19. Have you considered using the contentDocument property?
  20. It's probably best to report the error using the "REPORT ERROR" link at the bottom of the page so that the website staff will see it.
  21. I'm not sure this is the right place to ask the question. Most people here just do web development and aren't technicians.
  22. I'm sure I already told you this in another topic. The <iframe> element does not have a document property. You should check the reference page for iframe to find the property that you need to use. In Javascript, variables, properties and functions are case sensitive. If iframes had a "document" property, typing "Document" would not work.
  23. It's not entirely clear what the requirements are. If there were decorative items like <hr> or <img> you might not want to remove them.
  24. First, get all <p> elements. var elements = document.getElementsByTagName("p"); Then, loop through all of them. This has to be done in reverse order because deleting items reindexes the elements node list we obtained. (If you want to learn more about this I can explain it in more detail) var element; for(var i = elements.length-1; i >= 0; i--) { element = elements[i]; ... For each element in the loop, check its contents. This is the complicated part. You have to remove all <br> elements and whitespace from the element's innerHTML and check whether the result is empty. If it was just normal whitespace, the trim() method would be enough, but you wanted to check for <br> and &nbsp; so we need a regular expression. var contents = element.innerHTML; contents = contents.replace(/(<br[^>]>|&nbsp;|\s|\n|\r|\t)+/gi, ""); if(contents.length === 0) { element.parentNode.removeChild(element); }
  25. It can't be done. Most people build dialog boxes and buttons using HTML elements in order to change its content and appearance. There's an example of something like this on W3Schools: https://www.w3schools.com/howto/howto_css_delete_modal.asp You can assign events to the buttons using Javascript and change the appearance using CSS.
×
×
  • Create New...