HTML Menu Bar Which Switches to Dropdown for Mobile
For a web site to be successful it must tick several boxes. It needs an attractive design, great content, no pop-ups, not throw to many advertisements at visitors and work well on a variety of screen sizes. The last point is important as mobile devices are now the dominant platform for accessing the web. Achieving multi-screen support from a single web site saves time (no need to update the design more than once). Time is a precious resource for most people and businesses.
A web site needs to respond to the device it is being viewed on, hence the term responsive design. When a website uses a menu to allow the viewer to jump to other pages, that menu should work well on different screen sizes. This article is a responsive menu tutorial giving an example implementation of the Responsive Nav plugin. This provides a basic responsive web site menu without using any other frameworks or libraries. As the screen shrinks the menu switches from traditional horizontal to a button. The button is used to dropdown the menu on smaller screens. Continue reading
Create a Free Website Online Using WebMatrix, Azure and Microsoft Windows
If you have a Windows laptop or desktop computer you can get started with website development with free Microsoft tools. One of several free software tools that Microsoft provides is WebMatrix. This contains a HTML editor in an Integrated Development Environment (IDE) and the express version of Internet Information Server (IIS) (a web server used for testing your website). A Windows PC running WebMatrix allows you to develop a website and publish it online for free using Microsoft Azure cloud hosting. Microsoft free hosting is for a small number of low volume websites. If the website is successful and generates high traffic it can be upgraded to a registered domain and paid for high volume Azure hosting.
This tutorial was based upon using a Windows 8.1 PC but Windows 7 can run WebMatrix. You will need an Internet connection and a Microsoft account to install and run WebMatrix and to use Microsoft Azure. Continue reading
How to Remove the Small Spaces Between Images on a Web Page
This article deals with removing the small strips of space that can appear between two pictures placed onto a web page. It is easy to fix and you can use this article like a tutorial as example code is given.
A Basic Web Page with Two Images
A web page can be created in a simple text editor program, on a Windows PC the Notepad program under Accessories can be used, or better still a program like Notepad++ which provides color coding to help with the editing process. This is some basic code for a web page with two images:
The above code produces this web page that clearly shows a gap between the two images:
The reason for this space is due to the way that HTML is designed to handle whitespace. Continue reading
How HTML Elements are Affected By Padding, Border and Margin Properties
Padding, Border and Margin properties affect the space around a HTML element. When learning to author web pages understanding how the space around content is defined and used is fundamental design knowledge. The content of each item on a HTML page uses a Box Model when a web browser displays it, this article is a tutorial on understanding the content, padding, border and margin parts of that model.
There are two major types of HTML elements block, where the element content starts below the previous element, and inline, where the content starts next to the previous elements content. For example the paragraph (<p>) element separates text into blocks (this paragraph and the one above are in there own <p> element). Compared to the emphasized (<em>) element which usually gives text an italic look directly in the place it is used. Each element has some content, the space around content is defined in terms of padding (the space between the content and the border), border (the line around the content and padding), and margin (the space between the border and the surrounding elements). This is illustrated in this diagram from the CSS specification.
The padding, border and margin can be broken down into top, right, bottom and left segments, illustrated in the diagram i.e. TP for top padding, RB for right border, BM for bottom margin, LB for left border, etc., this is know as the Box Model. A simple HTML page can be used to see the Box Model in action. Create a HTML page with an image (see right) with a red border and some text with a blue border, the borders added using inline CSS. (On Windows this file can be created in Notepad, or use Notepad++ which adds color coding).
<img style="border:solid red" src="Mona_Lisa-Leonardo_da_Vinci.png"/>
<p style="border:solid blue">Mona Lisa</p>