Layers&Frames

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Layers&Frames - Presentation Transcript

    1. Layers & Frames
    2. Layers
      • Layer positioning
      • Properties of layers
      • Using layers
      • Nesting layers
      • Layers and tables
      • Formatting via layers
    3. Layer Positioning
      • A layer is a rectangular container (region) that holds XHTML content and can be positioned anywhere on a web page
      • Layer is placed using pixel coordinates
      • Layers organize and format page content
      • Initial layers get covered by new layers
    4. Layer Positioning
      • Appearance of layer content depends on the order of stacking
    5. Properties of Layers
      • The important properties are:
        • ID – specifies layer name
        • Location – measured relative to top left corner
        • Size – specifies width and height
        • Visibility – specifies whether a layer is hidden or visible
        • Background color – a colour can be assigned to a layer
        • Depth – represents its order of stacking
        • Clip –limits a layers’ displayable area
        • Overflow –what to do if content exceeds layer’s size
    6. Properties of Layers
    7. Using Layers
      • XHTML provides the <div> and the <span> tags to create layers (document sections)
        • <layer> and <ilayer> are obsolete
      • <div> - defines cascading style sheets (CSS) block layers
        • Attributes : id, position, left, top, width, height, z-index, border, background-color, background-image, visibility, overflow, clip
      • <span> - another tag to create layers in-line
    8. Using Layers (div)
      • <h2><center> Using 2 Layers </center></h2> < div id= &quot;Layer 1&quot; style= &quot;position: absolute ; width:300 px ; height:175 px ; left:54 px ; top:45 px ; background-color:#33FFFF; layer-background-color :#33FFFF; border:1 px &quot;><b>T his is layer 1 </b></div> < div id= &quot;Layer 2&quot; style= &quot;position: absolute ; width:200 px ; height:165 px ; left:54 px ; top:100 px ; background-color:red; layer-background-color:red; border:1 px &quot;><b> this is layer 2 </b></div>
      **Note all format details are in “style attribute”
    9. Nesting Layers
      • A nested layer is a layer inside another layer
      • Nesting layers allows better format and control of web page layout
      • A nested layer inherits the visibility of its parent layer
      • Nesting layers is not as complicated as table nesting
      • Example: 3-level nesting
      • <div>
        • <div>
          • <div>
      • </div>
      • </div>
      • </div>
    10. Nesting Layers
      • < div id= &quot;parent layer&quot; style= &quot;position: absolute ; width:400 px ; height:200 px ; left:50 px ; top:60 px ; background-color:#33FFFF; layer-background-color: #33FFFF; border: 1 px ; visibility: visible &quot;><b></b> <div id= &quot;layer 1&quot; style= &quot;position: absolute ; width:100 px ; height:100 px ; left:0 px ; top:0 px ; background-color:#FFFF66; layer-background-color: #FFFF66; border: 1 px ; visibility: visible &quot;><b> Cell 1 </b> </div> <div> <div id= &quot;layer 2&quot; style= &quot;position: absolute ; width:100 px ; height:100 px ; left:100 px ; top:0 px ; background-color:#00CC99; layer-background-color: #00CC99; border: 1 px ; visibility: visible &quot;><b> Cell 21 </b> </div> <div id= &quot;layer 3&quot; style= &quot;position: absolute ; width:100 px ; height:100 px ; left:200 px ; top:0 px ; background-color:#FFFF66; layer-background-color: #FFFF66; border: 1 px ; visibility: visible &quot;><b> Cell 22 </b>
      • </div> </div> </div>
      Cell 1 Cell 21 Cell 22
    11. Div Layers & Tables
      • Layers are simple to use and less restrictive
      • Layer nesting is simpler than table nesting
      • Tables use 5 tags for hierarchical structure whereas Layer just uses 1 tag for everything
      • Div Layers provide better control over formatting and layout
    12. Formatting Via Layers
      • Formatting via layers is based on the idea of nesting layers
      • Each layer can be viewed as an independent region that can hold any XHTML content
      • The web page is divided into regions according to its layout
      • Each region is then substituted by a layer
    13. Formatting Via Layers
    14. Frames
      • Frame layout and design
      • Frame sets and nesting
      • Using frames
      • Target frames and windows
    15. Frames
      • Web pages that do not use tables, layers or frames tend to be left-side heavy
      • Frames divide a browser window into regions, with each region having its own web page
      • When a surfer clicks on a link, from a set of links, the browser displays the corresponding HTML file in a new web page, which may not have the same links, for further navigation – frames solve this
    16. Frame Layout & Design
      • A frame is a rectangle that has a width and height, a location in a browser window, and content
      • A collection of frames is referred to as a frame set. It controls the layout of its frames
      • A frameset and a frame are created using the <frameset> and <frame> tags (+ <noframes> )
      • The <frameset> tag replaces <body> tag
    17. Frame Layout & Design
      • Useful tips:
        • Keep the frameset simple
        • Keep the frame’s content short
        • Keep the frames organised – use a driver frame
    18. Frame Sets & Nesting
      • A frame set width is defined by number of columns, cols
      • A frame set height is defined by number of rows, rows
      • Units of rows and cols can be pixels or percentage of browser window
    19. Frame Sets & Nesting
    20. Frame Sets & Nesting
    21. Frame Sets & Nesting
      • XHTML does not have a limit on the depth of frame nesting
      • However, one or two levels of nesting is all that is needed in practice
    22. Using Frames
      • There are 4 XHTML tags that can be used:
        • <frameset> - Encloses all other frame tags
          • Attributes : rows, cols : rows, cols
        • <frame> - Creates a frame in a frame set
          • Attributes : name, src, noresize, scrolling, frameborder, marginwidth, marginheight, longdesc
        • <iframe> - Creates an inline frame
          • Attributes : name, src, width, height, align, scrolling, frameborder, longdesc, marginwidth, marginheight
        • <noframes> - specifies alternative content for a browser
          • Attributes : NO ATTRIBUTES
    23. Using Frames
      • The <iframes> tag creates inline frames
      • An inline frame is a frame that is embedded inside the content of a Web page
      • No frame sets are required to create inline frames
      • Unlike the <frame> tag, the <iframe> tag is used inside the <body> tag
    24. Using Frames < frameset rows= &quot;*, *&quot; cols= &quot;50%, *&quot;> <frame src= &quot;....&quot; name= &quot;myFrame1&quot; frameborder= &quot;0&quot;/> <frame src= &quot;....&quot; name= &quot;myFrame2&quot; frameborder= &quot;0&quot;/> <frame src= &quot;....&quot; scrolling= &quot;no&quot;/> <frame src= &quot;....&quot; noresize marginwidth= &quot;0&quot; marginheight= &quot;0&quot;/> < /frameset >
    25. Using Nested Frames
      • < frameset cols= &quot;*, *&quot;> < frameset rows= &quot;*, *&quot;> < frame src= &quot;....&quot;/> <frame src= &quot;....&quot;/> </frameset>
      • < frame src= &quot;....&quot;/> </frameset>
    26. Target Frames & Windows
      • Frames optimize web page layout and facilitate navigation
      • Contents of some frames may never change and that of others may change frequently
      • Frames offer convenience to web surfers
      • Target frames receive content from other frames
      • Target frames must be given names when they are created i.e. use name attribute of the <frame> tag
      • The source frame can then refer to a target frame source by its name i.e. use target name attribute
    27. Target Frames & Windows
    28. Target Frames & Windows
      • < frameset cols= “160, *&quot;> < frame src= “toc.html&quot;/> <frame src= “initialContent.html“ name=“myTarget”/>
      • </frameset>
      • <h2> Click any link in the left frame…. </h2>
      • <a href= http://www.neu.edu target=“myTarget”>NU programs</a><br/>
      • <a href= http://www.mit.edu target=“myTarget”>MIT programs</a><br/>
      Example.html initialContent.html toc.html
    29. Reference
      • Steven M. Schafer (2005), HTML, CSS, JavaScript, Perl, and PHP Programmer's Reference , Hungry Minds Inc,U.S.
      • Dan Cederholm (2005), Bulletproof Web Design: Improving Flexibility and Protecting Against Worst-Case Scenarios with XHTML and CSS , New Riders.
      • Ibrahim Zeid (2004), Mastering the Internet, XHTML, and Javascript

    + Keith  FeigheryKeith Feighery, 11 months ago

    custom

    257 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 257
      • 257 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 1
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories