HTML Character Entities
Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag. If we want the browser to actually display these characters we must insert character entities in place of the actual characters themselves. The Most Common Character Entities: Result Description Entity Name Entity Number non-breaking space < less than < < > greater than > > & ampersand & & " quotation mark " " ' apostrophe ' (does not work in IE) ' A character entity has three parts: an ampersand (&), an entity name or an entity number, and finally a semicolon (;). The & means we are beginning a special character, the ; means ending a special character and the letters in between are sort of an abbreviation for what it's for. To display a less than sign in an HTML document we must write: < or < The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers. Note: Entities are case sensitive. Non-breaking Space The most common character entity in HTML is the non-breaking space . Normally HTML will truncate spaces in your text. If you add 10 spaces in your text, HTML will remove 9 of them. To add spaces to your text, use the character entity. This Code Would DisplayThis code would appear as this. This code would appear as this. This Code Would Display This code would appear with three extra spaces. This code would appear with three extra spaces. To see a list of character entities, visit this page: http://profdevtrain.austincc.edu/html/entities.htm HTML Fonts The tag in HTML is deprecated. The World Wide Web Consortium (W3C) has removed the tag from its recommendations. In future versions of HTML, style sheets (CSS) will be used to define the layout and display properties of HTML elements. The Tag Should NOT be used. HTML Backgrounds Backgrounds The tag has two attributes where you can specify backgrounds. The background can be a color or an image. Bgcolor The bgcolor attribute specifies a background-color for an HTML page. The value of this attribute can be a hexadecimal number, an RGB value, or a color name: The lines above all set the background-color to black. Background The background attribute can also specify a background-image for an HTML page. The value of this attribute is the URL of the image you want to use. If the image is smaller than the browser window, the image will repeat itself until it fills the entire browser window. The URL can be relative (as in the first line above) or absolute (as in the second line above). If you want to use a background image, you should keep in mind: Will the background image increase the loading time too much? Will the background image look good with other images on the page? Will the background image look good with the text colors on the page? Will the background image look good when it is repeated on the page? Will the background image take away the focus from the text? Note: The bgcolor, background, and the text attributes in the tag are deprecated in the latest versions of HTML (HTML 4 and XHTML). The World Wide Web Consortium (W3C) has removed these attributes from its recommendations. Style sheets (CSS) should be used instead (to define the layout and display properties of HTML elements). Try It Out! Open your text editor and type the following text: My First WebpageWelcome to my first webpage. I am writing this page using a text editor and plain old html. By learning html, I'll be able to create webpages like a beginner pro.... which I am of course. Save your page as mypage3.html and view it in your browser. To view how the page should look, visit this web page: http://profdevtrain.austincc.edu/html/mypage3.html Notice we gave our page a background color as well as a background image. If for some reason the web page is unable to find the picture, it will display our background color. HTML Colors Color Values Colors are defined using a hexadecimal notation for the combination of red, green, and blue color values (RGB). The lowest value that can be given to one light source is 0 (hex #00). The highest value is 255 (hex #FF). This table shows the result of combining red, green, and blue: Color Color HEX Color RGB #000000 rgb(0,0,0) #FF0000 rgb(255,0,0) #00FF00 rgb(0,255,0) #0000FF rgb(0,0,255) #FFFF00 rgb(255,255,0) #00FFFF rgb(0,255,255) #FF00FF rgb(255,0,255) #C0C0C0 rgb(192,192,192) #FFFFFF rgb(255,255,255) Color Names A collection of color names is supported by most browsers. To view a table of color names that are supported by most browsers visit this web page: http://profdevtrain.austincc.edu/html/color_names.htm Note: Only 16 color names are supported by the W3C HTML 4.0 standard (aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow). For all other colors you should use the Color HEX value. Color Color HEX Color Name #F0F8FF AliceBlue #FAEBD7 AntiqueWhite #7FFFD4 Aquamarine #000000 Black #0000FF Blue #8A2BE2 BlueViolet #A52A2A Brown Web Safe Colors A few years ago, when most computers supported only 256 different colors, a list of 216 Web Safe Colors was suggested as a Web standard. The reason for this was that the Microsoft and Mac operating system used 40 different "reserved" fixed system colors (about 20 each). This 216 cross platform web safe color palette was originally created to ensure that all computers would display all colors correctly when running a 256 color palette. To view the 216 Cross Platform Colors visit this web page: http://profdevtrain.austincc.edu/html/216.html 16 Million Different Colors The combination of Red, Green and Blue values from 0 to 255 gives a total of more than 16 million different colors to play with (256 x 256 x 256). Most modern monitors are capable of displaying at least 16,384 different colors. To assist you in using color schemes, check out http://wellstyled.com/tools/colorscheme2/index-en.html. This site lets you test different color schemes for page backgrounds, text and links. HTML Lists HTML provides a simple way to show unordered lists (bullet lists) or ordered lists (numbered lists). Unordered Lists An unordered list is a list of items marked with bullets (typically small black circles). An unordered list starts with the
Welcome to HTML Basics.
This workshop leads you through the basics of Hyper Text Markup Language (HTML). HTML is the building block for web pages. You will learn to use HTML to author an HTML page to display in a web browser. Objectives: By the end of this workshop, you will be able to: Use a text editor to author an HTML document. Be able to use basic tags to denote paragraphs, emphasis or special type. Create hyperlinks to other documents. Create an email link. Add images to your document. Use a table for layout. Apply colors to your HTML document. Prerequisites: You will need a text editor, such as Notepad and an Internet browser, such as Internet Explorer or Netscape. Q: What is Notepad and where do I get it? A: Notepad is the default Windows text editor. On most Windows systems, click your Start button and choose Programs then Accessories. It should be a little blue notebook. Mac Users: SimpleText is the default text editor on the Mac. In OSX use TextEdit and change the following preferences: Select (in the preferences window) Plain text instead of Rich text and then select Ignore rich text commands in HTML files. This is very important because if you don't do this HTML codes probably won't work. One thing you should avoid using is a word processor (like Microsoft Word) for authoring your HTML documents. What is an html File? HTML is a format that tells a computer how to display a web page. The documents themselves are plain text files with special "tags" or codes that a web browser uses to interpret and display information on your computer screen. HTML stands for Hyper Text Markup Language An HTML file is a text file containing small markup tags The markup tags tell the Web browser how to display the page An HTML file must have an htm or html file extension Try It? Open your text editor and type the following text: This is my first homepage. This text is bold Save the file as mypage.html. Start your Internet browser. Select Open (or Open Page) in the File menu of your browser. A dialog box will appear. Select Browse (or Choose File) and locate the html file you just created - mypage.html - select it and click Open. Now you should see an address in the dialog box, for example C:\MyDocuments\mypage.html. Click OK, and the browser will display the page. To view how the page should look, visit this web page: http://profdevtrain.austincc.edu/html/mypage.html Example Explained What you just made is a skeleton html document. This is the minimum required information for a web document and all web documents should contain these basic components. The first tag in your html document is . This tag tells your browser that this is the start of an html document. The last tag in your document is . This tag tells your browser that this is the end of the html document. The text between the tag and the tag is header information. Header information is not displayed in the browser window. The text between the This is my first homepage. This text is bold This is an HTML element: This text is bold The HTML element begins with a start tag: The content of the HTML element is: This text is bold The HTML element ends with an end tag: The purpose of the tag is to define an HTML element that should be displayed as bold. This is also an HTML element: This is my first homepage. This text is bold This HTML element starts with the start tag , and ends with the end tag . The purpose of the tag is to define the HTML element that contains the body of the HTML document. Nested Tags You may have noticed in the example above, the tag also contains other tags, like the tab. When you enclose an element in with multiple tags, the last tag opened should be the first tag closed. For example: This is NOT the proper way to close nested tags. This is the proper way to close nested tags. Note: It doesn't matter which tag is first, but they must be closed in the proper order. Why Use Lowercase Tags? You may notice we've used lowercase tags even though I said that HTML tags are not case sensitive. means the same as . The World Wide Web Consortium (W3C), the group responsible for developing web standards, recommends lowercase tags in their HTML 4 recommendation, and XHTML (the next generation HTML) requires lowercase tags. Tag Attributes Tags can have attributes. Attributes can provide additional information about the HTML elements on your page. The tells the browser to do something, while the attribute tells the browser how to do it. For instance, if we add the bgcolor attribute, we can tell the browser that the background color of your page should be blue, like this: . This tag defines an HTML table: . With an added border attribute, you can tell the browser that the table should have no borders: . Attributes always come in name/value pairs like this: name="value". Attributes are always added to the start tag of an HTML element and the value is surrounded by quotes. Quote Styles, "red" or 'red'? Attribute values should always be enclosed in quotes. Double style quotes are the most common, but single style quotes are also allowed. In some rare situations, like when the attribute value itself contains quotes, it is necessary to use single quotes: name='George "machine Gun" Kelly' Note: Some tags we will discuss are deprecated, meaning the World Wide Web Consortium (W3C) the governing body that sets HTML, XML, CSS, and other technical standards decided those tags and attributes are marked for deletion in future versions of HTML and XHTML. Browsers should continue to support deprecated tags and attributes, but eventually these tags are likely to become obsolete and so future support cannot be guaranteed. For a complete list of tags, visit W3C.org. Basic HTML Tags The most important tags in HTML are tags that define headings, paragraphs and line breaks. Basic HTML Tags Tag Description Defines an HTML document Defines the document's body defines the largest heading while defines the smallest.This is a headingThis is a headingThis is a headingThis is a heading This is a heading This is a headingHTML automatically adds an extra blank line before and after a heading. A useful heading attribute is align. I can align headings This is a centered heading This is a heading aligned to the rightParagraphs Paragraphs are defined with the tag. Think of a paragraph as a block of text. You can use the align attribute with a paragraph tag as well. This is a paragraph this is another paragraph Important: You must indicate paragraphs withelements. A browser ignores any indentations or blank lines in the source text. Without elements, the document becomes one large paragraph. HTML automatically adds an extra blank line before and after a paragraph. Line Breaks The tag is used when you want to start a new line, but don't want to start a new paragraph. The tag forces a line break wherever you place it. It is similar to single spacing in a document. This Code Would Display This is a para graph with line breaks This is a para graph with line breaks The tag has no closing tag. Horizontal Rule The element is used for horizontal rules that act as dividers between sections, like this: The horizontal rule does not have a closing tag. It takes attributes such as align and width. For instance: This Code Would Display Comments in HTML The comment tag is used to insert a comment in the HTML source code. A comment can be placed anywhere in the document and the browser will ignore everything inside the brackets. You can use comments to write notes to yourself, or write a helpful message to someone looking at your source code. This Code Would Display This html comment would be displayed like this. This HTML comment would be displayed like this. Notice you don't see the text between the tags . If you look at the source code, you would see the comment. To view the source code for this page, in your browser window, select View and then select Source. Note: You need an exclamation point after the opening bracket . HTML automatically adds an extra blank line before and after some elements, like before and after a paragraph, and before and after a heading. If you want to insert blank lines into your document, use the tag. Try It Out! Open your text editor and type the following text: -SHREE THAANU R.K Hey guys !! Welcome to ma blog !! This time we gonna learn about creating your first ios app on xcode ( hello world ) . Take a Look at Your First AppBefore we go into the coding part, let’s first take a look at our version of the “Hello World” app. The final deliverable will look like this: Your First iPhone App – Hello World It’s very simple and shows only a “Hello World” button. When tapped, the app prompts you a message. That’s it. Nothing complex but it helps you kick off your iOS programming journey. Start Coding!First, launch Xcode. If you’ve installed Xcode via Mac App Store, you should be able to locate Xcode in the LaunchPad. Just click on the Xcode icon to start it up. Once launched, Xcode displays a welcome dialog. From here, choose “Create a new Xcode project” to start a new project: Xcode – Welcome Dialog Xcode shows you various project template for selection. For your first app, choose “Single View Application” and click “Next”. Xcode Project Template Selection This brings you to another screen to fill in all the necessary options for your project. Project Options for Hello World App You can simply fill in the options as follows:
Pick a Folder to Save Your Project As you confirm, Xcode automatically creates the “Hello World” project based on all the options you provided. The screen will look like this: Main Xcode Window for Hello World Project Familiarize with Xcode WorkspaceBefore we move on to code your app, let’s take a few minutes to have a quick look at the Xcode workspace environment. On the left pane, it’s the project navigator. You can find all your files under this area. Project Navigator in Workspace The center part of the workspace is the editor area. You do all the editing stuffs (such as edit project setting, class file, user interface, etc) in this area depending on the type of file selected. Editor and Utility Area in Xcode The rightmost pane is the utility area. This area displays the properties of the file and allows you to access Quick Help. If Xcode doesn’t show this area, you can select the rightmost view button in the toolbar to enable it. Lastly, it’s the toolbar. It provides various functions for you to run your app, switch editor and the view of the workspace. Toolbar in Workspace Run Your App for the First TimeEven you haven’t written any code, you can run your app to try out the Simulator. This gives an idea how you build and test your app in Xcode. Simply hit the “Run” button in the toolbar. Run Button in Xcode Xcode automatically builds the app and runs it in the Simulator. This is how the Simulator looks like: The Simulator A gray screen with nothing inside?! That’s normal. As your app is incomplete, the Simulator just shows a blank screen. To terminate the app, simply hit the “Stop” button in the toolbar. Terminate the Running App Back to CodeOkay, let’s move on and start to add the Hello World button to our app. Go back to the Project Navigator and select “HelloWorldViewController.xib”. Select HelloWorld XIB File As you select the file, the editor changes to an Interface Builder and displays an empty view of your app like below: Interface Builder in Xcode In the lower part of the utility area, it shows the Object library. From here, you can choose any of the UI Controls, drag-and-drop it into the view. For the Hello World app, let’s pick the “Round Rect Button” and drag it into the view. Try to place the button at the center of the view. Drag the Round Rect Button to the View To edit the label of the button, double-click it and name it “Hello World”. Try to run the app again and you should have an app like this: Now Hello World with a Button For now, if you tap the button, it does nothing. We’ll need to add the code for displaying the “Hello, World” message. Coding the Hello World ButtonIn the Project Navigator, select the “HelloWorldViewController.h”. The editor area now displays the source code of the selected file. Add the following line of code before the “@end” line: 1 -(IBAction)showMessage; Your code should look like this after editing: Next, select the “HelloWordViewController.m” and insert the following code before the “@end” line: 1 2 3 4 5 6 7 8 - (IBAction)showMessage { UIAlertView *helloWorldAlert = [[UIAlertView alloc] initWithTitle:@"My First App" message:@"Hello, World!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; // Display the Hello World Message [helloWorldAlert show]; } After editing, your code should look like below: Source Code of HelloWorldViewController After Editing Forget about the meaning of the above Objective-C code. I’ll explain to you in the next post. For now, just think of “showMessage” as an action and this action instructs iOS to display a “Hello World” message on screen. Connecting Hello World Button with the ActionBut here is the question: How can the “Hello World” button know which action to invoke when someone taps on it? Next up, you’ll need to establish a connection between the “Hello World” button and the “showMessage” action you’ve just added. Select the “HelloWorldViewController.xib” file to go back to the Interface Builder. Press and hold the Control key on your keyboard, click the “Hello World” button and drag to the “File’s Owner”. Your screen should look like this: Release both buttons and a pop-up shows the “showMessage” action. Select it to make a connection between the button and “showMessage” action. Send Event Pop-up from File's Owner Test Your AppThat’s it! You’re now ready to test your first app. Just hit the “Run” button. If everything is correct, your app should run properly in the Simulator. Hello World App Congratulation! You’ve built your first iPhone app. It’s a simple app however, I believe you already have a better idea about Xcode and how an app is developed . - ShreeThaanu R.K ABOUT IT :
The iPhone is an amazing platform to develop on for indie software developers. It’s never been easier to come up with your own unique app idea, code something up, and have it be available to millions of potential customers! Lately I’ve been getting a lot of questions from people new to iOS development asking how to get started. So I thought it would be helpful to write an iOS tutorial series tailored for beginners. But rather than focusing in detail on just one topic, you’re going to dive in and create an entire functional app from scratch. By the end, you’ll have tried out many areas of iPhone development, and ready to dig in further. So what’s the app you’re going to make? Well, there’s a story behind that… What You NeedFirst things first – to develop for the iPhone, you’ll need a Mac. Pretty much any Mac will do, as long as it’s powerful enough to run the latest version of the Mac OS, Mavericks. But if you’re looking to go the cheap route, you can pick up a Mac Mini for relatively cheap, and it works just fine for a development machine. Next, you’ll need to get a copy of XCode, Apple’s IDE for iOS development. So if you haven’t already, register for a free account at the iPhone Dev Center and download a copy of Xcode from the Mac App Store. If you’d like, you can sign up for the paid iPhone Developer Program that allows you to distribute your apps on the App Store, but if you just want to try out iOS development the free account works fine. If you get serious about iOS development, you’ll probably want physical device(s) (iPhone 4/iPhone 5/iPod Touch/iPad) as well. It’s true that you can do a lot of testing with just the Simulator, but there are some APIs that don’t work on the Simulator, and you’ll need a physical device for performance testing. That’s it – so if you haven’t already, grab a copy of XCode, fire it up, and continue on!!!! - Shree Thaanu |
|
Photo used under Creative Commons from nan palmero