Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. You can test to see if innerHTML already has a value or not.
  2. Yes, it's technically true that programs that are lightweight make the processor do less work which has a tiny effect on reducing energy consumption. There are many reasons why editing files from cPanel is inconvenient: - Changes are immediate on your website, meaning that visitors might see your mistakes before you can fix them - You can only edit one file at a time - Loading and saving files is much slower - No help with indentation and no syntax highlighting makes writing code much slower If you really are serious about making websites, develop on your home computer and only upload files once you're done building and testing them.
  3. The image element is located at a discrete pixel position on the screen. The background may be being placed in a half-pixel position which causes the browser to draw one pixel of the image onto two pixels of the screen. This article is talking about the <canvas> element, but the effect is similar: http://seb.ly/2011/02/html5-canvas-sprite-optimisation/ I just want to show you the image they're displaying in the article.
  4. You can't manage forms without PHP or a similar server-side programming language, and in most cases PHP files must have a .php extension. I can't help you to understand it until you've begun learning the basics of PHP. If you're still only learning HTML and CSS, forget about forms, you need other languages to use them.
  5. This tool will show you the name of the closest named color to the color you select: http://www.workwithcolor.com/color-converter-01.htm The name will appear right next to the "Web color" field. Not every hexadecimal value has a name, because there are over 16 million possible combinations.
  6. This is incorrect. DeviantART's policies follow the USA copyright law. "Found on Google Images" or "found on deviantART" does not mean public domain. Artwork is considered public domain after 75 years following the death of the author, it is 50 years in some countries. Yes, that's a long time. I have plenty of artwork on deviantART that's over 175 days old and I have no plans of revoking my rights over it.
  7. This means that your file isn't being interpreted as PHP on the server. Does your file have a .php extension? If it does, does your server support PHP? PHP doesn't work on the browser, it needs a server to run it, so you can't test PHP files straight from your filesystem.
  8. I believe that if the two words are wrapped in a <span> tag you can target them and change the word spacing specifically for that part of the text.
  9. You can set them as a background image using CSS and give the element a specific width and height, but I recommend against using images for text at all. Search engines can't read them and even if you provide an alt text for the image they're given very little importance by search engines. Links and headings are especially important if you want your site to have a good rank on search engines. It's also important to use actual text instead of images for users who have text-only browsers, or users who are using screen readers because they have difficulty seeing. If you want a particular font on your page, use web fonts. You upload the font files on the server and call them with CSS. Remember that some browsers don't support certain kinds of font files, so upload the same font with a few different file formats.
  10. Ingolme

    button next to img

    Normally they would be on the same line without needing any extra CSS. Is the container too small to fit them both? If the container is shrinking to fit the content (probably because of a float or display: inline-block) then it might be forcing line breaks . In that case, try setting the container's white-space property to nowrap.
  11. Rather than using a click event on a button, use the submit event of the form: $("#addressPForm").submit(function(e) { // ...}); The click event will only work if the button is clicked, but when Enter is pressed. jQuery allows e.preventDefault() to work in Internet Explorer.
  12. What's happening is that when you mouseover the video you're giving it one specific file to use, which might be of a file type that the browser is not compatible with. The second problem is that when you mouseover, the file you're changing it to has to be loaded from scratch and it will start from the beginning. There's no real solution for this. You can't have two videos playing at the same time or the sound will overlap and they'll likely desynchronize after a while due to different streaming speeds. My suggestion is to only load the large video and just change the width and height of the container using Javascript.
  13. You could combine image maps with Javascript event listeners.
  14. It seems that the datalist provides possible values for text inputs. Text inputs only take one value.
  15. Hyperlinks in editable text don't work so that a person won't accidentally leave the page when trying to edit the text. Once you've stopped it from being editable the link should work properly.
  16. I don't fully understand AngularJS. Is it server-side or client-side? The site mentions node.js which is server-side. Anyways, I found the same question here: http://stackoverflow.com/questions/12740329/math-functions-in-angular-bindings Perhaps that will be useful.
  17. You should be able to access Math without $scope. Did you try just calling alert(Math.pow(2, 3)); to see if it's working? If that doesn't work, check the browser console for error messages and let me know what they say.
  18. It's acceptable to use MySQLi. PDO is just newer and probably better. The original MySQL library for PHP is deprecated because it doesn't have support for prepared statements, transactions or other features. The page you linked to has a good breakdown of the features, which is what you should consider when choosing an API for your project.
  19. You can combine lightbox with some Javascript and cookies or web storage. The light box makes the image appear in front of the page. You need a bit of Javascript to make the lightbox open automatically, and you use cookies to tell the user's computer to remember that it already showed the box to them.
  20. I'm not very familiar with Backbone. It says it can take a space-separated list of events, but is input#name an event? They also say that their events module is intended for custom firing and catching events on Backbone objects, I don't think it listens for browser events or events on HTML elements.
  21. The script and the input fields should be on the same page. There's no need for a <form> element, so remove that. Wrap your script in a function called Calculate(). In that function, use getElementById() to access the form elements and get their value property, assign those values to the Z, AT and LMB variables.
  22. Are you sure it's valid syntax to have both the event type and an element selector in the same string? I'd imagine it probably should be something like this: $("input#name").on("keyup",this.test);
  23. This has to do with HTML entities The solution to your problem is to just substitute the & for &. I would recommend reading what an entity is and why it is used so that you can understand what is actually happening.
  24. Ingolme

    Inner border

    That's called "collapsing margins". You can find a fix for them: http://stackoverflow.com/questions/16485810/how-to-fix-collapsing-top-and-bottom-margins
  25. Neither HTML 5 nor CSS 3 can do that. Javascript necessary to validate form fields. HTML is for describing data and CSS only deals with presentation. You use Javascript to manage behavior.
×
×
  • Create New...