Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. x modulo 20 should always be a number smaller than 20. Since 33 is greater than 20 that equation is false. I'll be using "%" as a shorthand for modulo since most programming languages do that. If you ask me how to find a number that satisfies the equation x % 20 = k, I'd go by the definition that the modulo is the remainder of the division. This means that the equation can be rewritten as this: (x - k) / 20 = n, where n is any natural number. Solving for x you would get x = 20 * n + k. There are as many solutions as values of n. Since there are infinite natural numbers there are infinite solutions. Since k cannot possibly have 33 as a value, here are a few solutions for k = 10 instead: 30 % 20 = 10 50 % 20 = 10 70 % 20 = 10 150 % 20 = 10
  2. Concatenate the values before printing them. var s = "hello w3schools how are you doing"; var output = ""; for(i = 0; i < s.length; i++) { output += String(s.charCodeAt(i)) + " "; } console.log(output);
  3. At the bottom of every manual page there's a comments section. In that section you'll often find interesting additional information about the topic at hand. The same goes for the PHP manual too. From reading peoples' comments on the page you just linked to, it seems like a search term that occurs in more than 50% of the records is ignored. That may or may not be the reason you're having trouble.
  4. Please stop making duplicate threads and stop using all capital letters in your titles. You can prevent them from sticking together by removing the float:left rule from the .tab button selector. They're not blocks, so they don't need to be floated to be next to each other. You can also add space between them setting the margin property of the buttons.
  5. Ingolme

    Web page.

    Hyperlinks will work for you because they send you to a file on your computer, but browser security features prevent embedding files from your computer into an HTML page because hackers can use that as an indirect method to explore your filesystem. You must put the video on the server and embed it using the URL relative to the server root, which is probably localhost. The video URL might look something like this: http://localhost/The_book_of_Revelation_1a.mp4
  6. Ingolme

    Web page.

    You can't use the computer's local file path for the video file. It has to be relative to the website's root as specified by the server software.
  7. The website owners are not frequently on the forums, but if you think there is something that should be fixed, there's a "report error" button on every page on the site. Clicking on it will let you provide feedback about the content on the page. Here's the page describing the box model [https://www.w3schools.com/css/css_boxmodel.asp], you can use the "report error" feature there.
  8. Ingolme

    Sources

    All web hosts allow you to upload files, some web hosts are free. If you don't have a web host, you don't have a website. Google Drive is not a web host because it cannot be used to publicly display websites, it is just for file storage.
  9. You need to create a program on the server-side that will take the form data and send an e-mail. Here's the PHP tutorial for handling forms: https://www.w3schools.com/php/php_forms.asp Here's the PHP tutorial for sending an e-mail: https://www.w3schools.com/php/func_mail_mail.asp You have unnecessary Javascript on that page. Remove all of the content in the <script> tags and use <input type="submit"> instead of "button". The submit button will submit the form for you.
  10. Ingolme

    Web page.

    Make sure that the video file is on your web host and that the full path to the video is correct.
  11. Ingolme

    Sources

    Sign up to a web host and upload the video file through FTP, like you would do with an HTML file.
  12. No, there is not a way to do that in any of the major browsers.
  13. There is no reason to avoid the CSS solution. The only reason Javascript solutions exist is because they were created back when CSS did not have this option. Just a note: Safari is outdated and only supports sticky position with the -webkit- prefix. You should have both declarations whenever you want something to be sticky: .element { position: -webkit-sticky; position: sticky; }
  14. The "overflow: hidden" rule is going to make your menu invisible. Remove it. I've been seeing this a lot lately, where are people getting this code?
  15. You don't need a <form> element, but you will need form controls. Start by setting up your inputs <select id="months"> <option value="January">January</option> <option value="February">February</option> <option value="March">March</option> ... <option value="December">December</option> </select> <select id="years"> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> ... <option value="2018">2018</option> </select> <select id="extension"> <option value="pdf">Show as PDF</option> <option value="doc">Show as Word</option> <option value="html">Show in Browser</option> </select> <button id="go">Open</button> Your script needs to access the button and the inputs using document.getElementById(). When the button is clicked, combine the values of the inputs into the name of the file. You should also specify the path of the file in the resulting string. Once that's done, you can use window.open() to open the document in a new window, or location.href to open it in the current window.
  16. You can use "position: sticky" in your CSS to make the navbar stick to the top when scrolling down the page.
  17. Ingolme

    Flash Help

    It can be done by programming in Javascript. I'd estimate at least two full work days of development time. Before starting to program anything, the requirements should be made more clear, describing the inputs and outputs of every state in the process.
  18. Javascript runs as soon as it begins loading. If the elements that it is trying to access are further down in the document then they won't be available to the script.
  19. If you intend to select and copy the result it might be better to print the result onto the page instead. var s = "hello w3schools how are you doing"; var output = ""; for(i = 0; i < s.length; i++) { output += String(s.charCodeAt(i)) + "<br>"; } var div = document.createElement("div"); div.innerHTML = output; document.body.appendChild(div);
  20. The problem is that the selectors above are much more specific than the ones below, you will need to add additional selectors to override the bootstrap ones. There are some quick ways to easily override all rules, but I would be careful with them as it would make it much more difficult to override your own rules later. If your <body> element has an ID, the ID selector takes precedence over all other selectors. Given this body tag <body id="site">, these selectors would change all links: #site a:link { color: blue; } #site a:hover { color: red; } #site a:active { color: yellow; } #site a:focus { color: green; } The only way to override this is by using another ID selector.
  21. My guess is that <div class="shade"> is the one responsible for the background. I don't know exactly how it is being styled, it would be an rgba() color, or it could be a solid color with opacity. This should work, unless the element has its opacity altered with CSS: <div class="shade" style="background-color:#07074e"></div> If the box is still transparent after that, then set the opacity property to 1.
  22. All of this is very basic CSS. You should be able to easily find the answers to all your questions in the selector reference and the property reference. If that's a bit too advanced, take a while to read through the CSS tutorial. You already know how to use the font-size rule, so just apply it to the menu item. If you want to change the text color instead of the background, then change the color property instead of the background-color property. You can select individual elements of the menu using the :nth-child() selector.
  23. Why did you give the player an absolute position? Give it a relative position. Absolute positioning breaks the page flow and makes layouts a nightmare to work with.
  24. I'm not sure what you mean by cover page, but there is a way to make the height scale proportionally to the width in an iframe. Because it's an iframe, the aspect ratio of the video is not known. If you do know the aspect ratio beforehand, a technique to keep it responsive is to wrap it in a container and use a percentage padding. To calculating the necessary padding, take the aspect ratio of the video, which might be 16:9, then solve the equation 16/9 = 100/x -> x = 100 * 9/16 = 56.25. Now you can wrap the video in a container with the desired width and the percentage height: <div class="video-wrapper" style="padding-bottom:56.25%"> <iframe src="//www.youtube.com/embed/fPWzv" frameborder="0" allowfullscreen="" width="700" height="700"></iframe> </div> .video-wrapper { /* Choose your width, or don't specify it to take the full width of the parent container */ width: 70%; /* The following rules are necessary */ height: 0; position: relative; overflow: hidden; } /* Force the iframe to occupy all the space in the parent element */ .video-wrapper iframe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
  25. Without the HTML itself, I can't tell you why the selectors are not selecting the right elements. The attached stylesheet has this: -ms-[title~="flower"] That will not work because of the "-ms-" part. The selector [class|="top"] in your stylesheet will work for any element that has a class attribute starting with "top"
×
×
  • Create New...