Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML Frames HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection.

Similar presentations


Presentation on theme: "HTML Frames HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection."— Presentation transcript:

1 HTML Frames HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection of frames in the browser window is known as a frameset. The window is divided into frames in a similar way the tables are organized: into rows and columns. Creating Frames To use frames on a page we use tag instead of tag. The tag defines how to divide the window into frames. The rows attribute of tag defines horizontal frames and cols attribute defines vertical frames. Each frame is indicated by tag and it defines which HTML document shall open into the frame. CENG 449 Lecture 41

2 HTML Frames Your browser does not support frames. CENG 449 Lecture 42

3 CENG 449 Lecture 43

4 The Tag Attributes Following are important attributes of the tag: AttributeDescription colsspecifies how many columns are contained in the frameset and the size of each column. You can specify the width of each column in one of four ways: Absolute values in pixels. For example to create three vertical frames, use cols="100, 500,100". A percentage of the browser window. For example to create three vertical frames, use cols="10%, 80%,10%". Using a wildcard symbol. For example to create three vertical frames, use cols="10%, *,10%". In this case wildcard takes remainder of the window. As relative widths of the browser window. For example to create three vertical frames, use cols="3*,2*,1*". This is an alternative to percentages. You can use relative widths of the browser window. Here the window is divided into sixths: the first column takes up half of the window, the second takes one third, and the third takes one sixth. CENG 449 Lecture 44

5 rows:This attribute works just like the cols attribute and takes the same values, but it is used to specify the rows in the frameset. For example to create two horizontal frames, use rows="10%, 90%". You can specify the height of each row in the same way as explained above for columns. border: This attribute specifies the width of the border of each frame in pixels. For example border="5". A value of zero means no border. frameborder:This attribute specifies whether a three-dimensional border should be displayed between frames. This attrubute takes value either 1 (yes) or 0 (no). For example frameborder="0" specifies no border. framespacing: This attribute specifies the amount of space between frames in a frameset. This can take any integer value. For example framespacing="10" means there should be 10 pixels spacing between each frames. CENG 449 Lecture 45

6 The Tag Attributes AttributeDescription src:This attribute is used to give the file name that should be loaded in the frame. Its value can be any URL. For example, src="/html/top_frame.htm" will load an HTML file available in html directory. name:This attribute allows you to give a name to a frame. It is used to indicate which frame a document should be loaded into. This is especially important when you want to create links in one frame that load pages into an another frame, in which case the second frame needs a name to identify itself as the target of the link. frameborder:This attribute specifies whether or not the borders of that frame are shown; it overrides the value given in the frameborder attribute on the tag if one is given, and this can take values either 1 (yes) or 0 (no). marginwidth:This attribute allows you to specify the width of the space between the left and right of the frame's borders and the frame's content. The value is given in pixels. For example marginwidth="10". marginheight:This attribute allows you to specify the height of the space between the top and bottom of the frame's borders and its contents. The value is given in pixels. For example marginheight="10". CENG 449 Lecture 46

7 Noresize By default you can resize any frame by clicking and dragging on the borders of a frame. The noresize attribute prevents a user from being able to resize the frame. For example noresize="noresize". Scrolling This attribute controls the appearance of the scrollbars that appear on the frame. This takes values either "yes", "no" or "auto". For example scrolling="no" means it should not have scroll bars. longdesc This attribute allows you to provide a link to another page containing a long description of the contents of the frame. For example longdesc="framedescription.htm" CENG 449 Lecture 47

8 Browser Support for Frames If a user is using any old browser or any browser which does not support frames then element should be displayed to the user. So you must place a element inside the element because the element is supposed to replace the element, but if a browser does not understand element then it should understand what is inside the element which is contained in a element. You can put some nice message for your user having old browsers. For example Sorry!! your browser does not support frames. as shown in the above example. CENG 449 Lecture 48

9 Frame's name and target attributes One of the most popular uses of frames is to place navigation bars in one frame and then load main pages into a separate frame. Let's see following example where a test.htm file has following code: HTML Target Frames Your browser does not support frames. Here we have created two columns to fill with two frames. The first frame is 200 pixels wide and will contain the navigation menubar implemented by menu.htm file. The second column fills in remaining space and will contain the main part of the page and it is implemented by main.htm file. For all the three links available in menubar, we have mentioned target frame as main_page, so whenever you click any of the links in menubar, available link will open in main_page. CENG 449 Lecture 49

10 Following is the content of menu.htm file Google Microsoft BBC News Following is the content of main.htm file: This is main page and content from any link will be displayed here. So now click any link and see the result. CENG 449 Lecture 410

11 The target attribute can also take one of the following values: OptionDescription _self:Loads the page into the current frame. _blank:Loads a page into a new browser window.opening a new window. _parent:Loads the page into the parent window, which in the case of a single frameset is the main browser window. _top:Loads the page into the browser window, replacing any current frames. targetframe:Loads the page into a named targetframe. CENG 449 Lecture 411

12 HTML5 - Audio & Video HTML5 features, include native audio and video support without the need for Flash. The HTML5 and tags make it simple to add media to a website. You need to set src attribute to identify the media source and include a controls attribute so the user can play and pause the media. Embedding Video: Here is the simplest form of embedding a video file in your webpage: Your browser does not support the element. CENG 449 Lecture 412

13 Adding HTML5 Video A video of a puppy playing in the snow CENG 449 Lecture 413

14 CENG 449 Lecture 414

15 Adding HTML5 Video A video of a puppy playing in the snow CENG 449 Lecture 415

16 Video Attribute Specification: The HTML5 video tag can have a number of attributes to control the look and feel and various functionalities of the control: AttributeDescription autoplayThis boolean attribute if specified, the video will automatically begin to play back as soon as it can do so without stopping to finish loading the data. autobuffer This boolean attribute if specified, the video will automatically begin buffering even if it's not set to automatically play. controlsIf this attribute is present, it will allow the user to control video playback, including volume, seeking, and pause/resume playback. heightThis attribut specifies the height of the video's display area, in CSS pixels. loopThis boolean attribute if specified, will allow video automatically seek back to the start after reaching at the end. preloadThis attribute specifies that the video will be loaded at page load, and ready to run. Ignored if autoplay is present. posterThis is a URL of an image to show until the user plays or seeks. srcThe URL of the video to embed. This is optional; you may instead use the element within the video block to specify the video to embed widthThis attribut specifies the width of the video's display area, in CSS pixels. CENG 449 Lecture 416

17 Embedding Audio: HTML5 supports tag which is used to embed sound content in an HTML or XHTML document as follows. Your browser does not support the element. Your browser does not support the element. CENG 449 Lecture 417

18 Multiple Audio Sources This browser does not support our audio format. CENG 449 Lecture 418

19 Audio Attribute Specification: The HTML5 audio tag can have a number of attributes to control the look and feel and various functionalities of the control: AttributeDescription autoplayThis boolean attribute if specified, the audio will automatically begin to play back as soon as it can do so without stopping to finish loading the data. autobufferThis boolean attribute if specified, the audio will automatically begin buffering even if it's not set to automatically play. controlsIf this attribute is present, it will allow the user to control audio playback, including volume, seeking, and pause/resume playback. loopThis boolean attribute if specified, will allow audio automatically seek back to the start after reaching at the end. preloadThis attribute specifies that the audio will be loaded at page load, and ready to run. Ignored if autoplay is present. srcThe URL of the audio to embed. This is optional; you may instead use the element within the video block to specify the video to embed CENG 449 Lecture 419

20 HTML Colors Colors are very important to give a good look and feel to your website. You can specify colors on page level using tag or you can set colors for individual tags using bgcolor attribute. The tag has following attributes which can be used to set different colors: bgcolor - sets a color for the background of the page. text - sets a color for the body text. alink - sets a color for active links or selected links. link - sets a color for linked text. vlink - sets a color for visited links - that is, for linked text that you have already clicked on. CENG 449 Lecture 420

21 HTML Color Coding Methods There are following three different methods to set colors in your web page: Color names - You can specify color names directly like green, blue or red. Hex codes - A six-digit code representing the amount of red, green, and blue that makes up the color. Color decimal or percentage values - This value is specified using the rgb( ) property. CENG 449 Lecture 421

22 W3C Standard 16 Colors Here is the list of W3C Standard 16 Colors names and it is recommended to use them. BlackGraySilverWhite YellowLimeAquaFuchsia RedGreenBluePurple MaroonOliveNavyTeal CENG 449 Lecture 422

23 HTML Colors by Name Use different color names for for body and table and see the result. This text will appear white on black background. CENG 449 Lecture 423

24 HTML Colors by Hex Use different color hexa for for body and table and see the result. This text will appear white on black background. HTML Colors by RGB code Use different color code for for body and table and see the result. This text will appear white on black background. CENG 449 Lecture 424

25 Setting Font Face You can set font face using face attribute but be aware that if the user viewing the page doesn't have the font installed, they will not be able to see it. Instead user will see the default font face applicable to the user's computer. Font Face Times New Roman Verdana Comic Sans MS WildWest Bedrock CENG 449 Lecture 425

26 Setting Font Color You can set any font color you like using color attribute. You can specify the color that you want by either the color name or hexadecimal code for that color. Setting Font Color This text is in pink This text is red CENG 449 Lecture 426

27 HTML Marquees An HTML marquee is a scrolling piece of text displayed either horizontally across or vertically down your webpage depending on the settings. This is created by using HTML tag. HTML marquee Tag This text will scroll from left to right HTML marquee Tag This text will scroll from bottom to up CENG 449 Lecture 427

28 CENG 449 Lecture 428

29 CENG 449 Lecture 429


Download ppt "HTML Frames HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection."

Similar presentations


Ads by Google