SlideShare a Scribd company logo
1 of 20
SVG(ScalableSVG(Scalable
Vector Graphics)Vector Graphics)
infobizzs.com
What is SVG?What is SVG?
• SVG stands for Scalable Vector Graphics.
• SVG defines vector-based graphics in XML format.
• SVG stands for Scalable Vector Graphics.
• SVG is used to define vector-based graphics for the Web.
• SVG defines the graphics in XML format.
• SVG graphics do NOT lose any quality if they are zoomed or
resized .
• Every element and every attribute in SVG files can be animated.
• SVG is a W3C recommendation.
• SVG integrates with other W3C standards such as the DOM and
XSL.
infobizzs.com
SVG AdvantagesSVG Advantages
Advantages of using SVG over other image formats (like JPEG and
GIF) are:
• SVG images can be created and edited with any text editor
• SVG images can be searched, indexed, scripted, and
compressed
• SVG images are scalable
• SVG images can be printed with high quality at any
resolution
• SVG images are zoomable (and the image can be zoomed
without degradation)
• SVG is an open standard
• SVG files are pure XML
infobizzs.com
SVG in HTMLSVG in HTML
• In HTML5, you can embed SVG elements directly into your
HTML pages.
• Here is an example of a simple SVG graphic:
• and here is the HTML code:
infobizzs.com
ExampleExample
<!DOCTYPE html>
<html>
<body>
<h1>My first SVG</h1>
<svg width="100" height="100">
  <circle cx="50" cy="50" r="40" stroke="green" stroke-
width="4" fill="yellow" />
</svg>
</body>
</html>
infobizzs.com
OutputOutput
infobizzs.com
SVG Code explanation:SVG Code explanation:
infobizzs.com
• An SVG image begins with an <svg> element
• The width and height attributes of the <svg> element define the
width and height of the SVG image
• The <circle> element is used to draw a circle
• The cx and cy attributes define the x and y coordinates of the
center of the circle. If cx and cy are omitted, the circle's center is set
to (0, 0)
• The r attribute defines the radius of the circle
• The stroke and stroke-width attributes control how the outline of a
shape appears. We set the outline of the circle to a 4px green
"border“
•
• The fill attribute refers to the color inside the circle. We set the fill
color to yellow
• The closing </svg> tag closes the SVG image
SVG ShapesSVG Shapes
SVG has some predefined shape elements that can be used by
developers:
• Rectangle <rect>
• Circle <circle>
• Ellipse <ellipse>
• Line <line>
• Polyline <polyline>
• Polygon <polygon>
• Path <path>
infobizzs.com
SVG Rectangle - <rect>SVG Rectangle - <rect>
• The <rect> element is used to create a rectangle and variations
of a rectangle shape:
• Here is the SVG code:
infobizzs.com
ExampleExample
<svg width="400" height="110">
  <rect width="300" height="100“
style="fill:rgb(0,0,255);
stroke-width:3;stroke:rgb(0,0,0)" />
</svg>
OutputOutput
infobizzs.com
Code explanation:Code explanation:
• The width and height attributes of the <rect> element define the
height and the width of the rectangle
• The style attribute is used to define CSS properties for the
rectangle
• The CSS fill property defines the fill color of the rectangle
• The CSS stroke-width property defines the width of the border of
the rectangle
• The CSS stroke property defines the color of the border of the
rectangle
infobizzs.com
SVG Circle - <circle>SVG Circle - <circle>
• The <circle> element is used to create a circle:
• Here is the SVG code:
infobizzs.com
ExampleExample
<svg height="100" width="100">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-
width="3" fill="red" />
</svg>
OutputOutput
infobizzs.com
Code explanation:Code explanation:
• The cx and cy attributes define the x and y coordinates of the
center of the circle. If cx and cy are omitted, the circle's center is
set to (0,0)
• The r attribute defines the radius of the circle
infobizzs.com
SVG Ellipse - <ellipse>SVG Ellipse - <ellipse>
• The <ellipse> element is used to create an ellipse.
• An ellipse is closely related to a circle. The difference is that an
ellipse has an x and a y radius that differs from each other, while
a circle has equal x and y radius:
• The following example creates an ellipse:
• Here is the SVG code:
infobizzs.com
ExampleExample
• <svg height="140" width="500">
  <ellipse cx="200" cy="80" rx="100" ry="50"
  style="fill:yellow;stroke:purple;stroke-width:2" />
</svg>
Output
infobizzs.com
Code explanation:Code explanation:
• The cx attribute defines the x coordinate of the center
of the ellipse
• The cy attribute defines the y coordinate of the center
of the ellipse
• The rx attribute defines the horizontal radius
• The ry attribute defines the vertical radius
infobizzs.com
SVG Line - <line>SVG Line - <line>
• The <line> element is used to create a line:
• Here is the SVG code:
infobizzs.com
ExampleExample
<svg height="210" width="500">
<line x1="0" y1="0" x2="200" y2="200"
style="stroke:rgb(255,0,0);stroke-width:2" />
</svg>
OutputOutput
infobizzs.com
Code explanation:Code explanation:
• The x1 attribute defines the start of the line on the x-
axis
• The y1 attribute defines the start of the line on the y-
axis
• The x2 attribute defines the end of the line on the x-
axis
• The y2 attribute defines the end of the line on the y-
axis
infobizzs.com

More Related Content

What's hot

Responsive web-design through bootstrap
Responsive web-design through bootstrapResponsive web-design through bootstrap
Responsive web-design through bootstrapZunair Sagitarioux
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsShweta Sadawarte
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basicsEliran Eliassy
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignZoe Gillenwater
 
Html links
Html linksHtml links
Html linksJayjZens
 
Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTMLAarti P
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycleDhruvin Nakrani
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)Keshab Nath
 
HTML frames and HTML forms
HTML frames and HTML formsHTML frames and HTML forms
HTML frames and HTML formsNadine Cruz
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Propertieshstryk
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The BasicsJeff Fox
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS PresentationShawn Calvert
 
Asp.net html server control
Asp.net html  server controlAsp.net html  server control
Asp.net html server controlSireesh K
 

What's hot (20)

Responsive web-design through bootstrap
Responsive web-design through bootstrapResponsive web-design through bootstrap
Responsive web-design through bootstrap
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector Graphics
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
Java script
Java scriptJava script
Java script
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
Html links
Html linksHtml links
Html links
 
Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTML
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
 
Html forms
Html formsHtml forms
Html forms
 
HTML frames and HTML forms
HTML frames and HTML formsHTML frames and HTML forms
HTML frames and HTML forms
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
 
CSS Grid
CSS GridCSS Grid
CSS Grid
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
jQuery
jQueryjQuery
jQuery
 
Asp.net html server control
Asp.net html  server controlAsp.net html  server control
Asp.net html server control
 

Viewers also liked

HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVGyarcub
 
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics APdgmit2009
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) Sara Soueidan
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examplesAlfredo Torre
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to BootstrapRon Reiter
 

Viewers also liked (7)

HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVG
 
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP 제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
제 5회 DGMIT R&D 컨퍼런스: HTML Graphics AP
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers)
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
Bootstrap ppt
Bootstrap pptBootstrap ppt
Bootstrap ppt
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 

Similar to Svg

SVG (Devoxx 2011, 2011-NOV-14)
SVG (Devoxx 2011, 2011-NOV-14)SVG (Devoxx 2011, 2011-NOV-14)
SVG (Devoxx 2011, 2011-NOV-14)Filip Van Laenen
 
SVG (Framsia, 27-SEP-2011)
SVG (Framsia, 27-SEP-2011)SVG (Framsia, 27-SEP-2011)
SVG (Framsia, 27-SEP-2011)Filip Van Laenen
 
Drawing a Circle Three Ways: Generating Graphics for the Web
Drawing a Circle Three Ways: Generating Graphics for the WebDrawing a Circle Three Ways: Generating Graphics for the Web
Drawing a Circle Three Ways: Generating Graphics for the WebCloudinary
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSGil Fink
 
MTA managing the graphical interface by using css
MTA managing the graphical interface by using cssMTA managing the graphical interface by using css
MTA managing the graphical interface by using cssDhairya Joshi
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?Mike Wilcox
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvasGary Yeh
 
Graphics 2D SVG
Graphics 2D SVGGraphics 2D SVG
Graphics 2D SVGMinh Huong
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas DetailNisa Soomro
 
Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive GraphicsBlazing Cloud
 

Similar to Svg (20)

5. SVG.pptx
5. SVG.pptx5. SVG.pptx
5. SVG.pptx
 
SVG Animations
SVG AnimationsSVG Animations
SVG Animations
 
SVG (Devoxx 2011, 2011-NOV-14)
SVG (Devoxx 2011, 2011-NOV-14)SVG (Devoxx 2011, 2011-NOV-14)
SVG (Devoxx 2011, 2011-NOV-14)
 
SVG (Framsia, 27-SEP-2011)
SVG (Framsia, 27-SEP-2011)SVG (Framsia, 27-SEP-2011)
SVG (Framsia, 27-SEP-2011)
 
Drawing a Circle Three Ways: Generating Graphics for the Web
Drawing a Circle Three Ways: Generating Graphics for the WebDrawing a Circle Three Ways: Generating Graphics for the Web
Drawing a Circle Three Ways: Generating Graphics for the Web
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJS
 
MTA managing the graphical interface by using css
MTA managing the graphical interface by using cssMTA managing the graphical interface by using css
MTA managing the graphical interface by using css
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
 
SVG and the web
SVG and the webSVG and the web
SVG and the web
 
Graphics 2D SVG
Graphics 2D SVGGraphics 2D SVG
Graphics 2D SVG
 
Html 5 svg
Html 5 svgHtml 5 svg
Html 5 svg
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
Learn svg
Learn svgLearn svg
Learn svg
 
SVG overview
SVG overviewSVG overview
SVG overview
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas Detail
 
Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive Graphics
 
Iagc2
Iagc2Iagc2
Iagc2
 
Powerbidays april 2019
Powerbidays april 2019Powerbidays april 2019
Powerbidays april 2019
 

Recently uploaded

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Recently uploaded (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

Svg

  • 2. What is SVG?What is SVG? • SVG stands for Scalable Vector Graphics. • SVG defines vector-based graphics in XML format. • SVG stands for Scalable Vector Graphics. • SVG is used to define vector-based graphics for the Web. • SVG defines the graphics in XML format. • SVG graphics do NOT lose any quality if they are zoomed or resized . • Every element and every attribute in SVG files can be animated. • SVG is a W3C recommendation. • SVG integrates with other W3C standards such as the DOM and XSL. infobizzs.com
  • 3. SVG AdvantagesSVG Advantages Advantages of using SVG over other image formats (like JPEG and GIF) are: • SVG images can be created and edited with any text editor • SVG images can be searched, indexed, scripted, and compressed • SVG images are scalable • SVG images can be printed with high quality at any resolution • SVG images are zoomable (and the image can be zoomed without degradation) • SVG is an open standard • SVG files are pure XML infobizzs.com
  • 4. SVG in HTMLSVG in HTML • In HTML5, you can embed SVG elements directly into your HTML pages. • Here is an example of a simple SVG graphic: • and here is the HTML code: infobizzs.com
  • 5. ExampleExample <!DOCTYPE html> <html> <body> <h1>My first SVG</h1> <svg width="100" height="100">   <circle cx="50" cy="50" r="40" stroke="green" stroke- width="4" fill="yellow" /> </svg> </body> </html> infobizzs.com
  • 7. SVG Code explanation:SVG Code explanation: infobizzs.com • An SVG image begins with an <svg> element • The width and height attributes of the <svg> element define the width and height of the SVG image • The <circle> element is used to draw a circle • The cx and cy attributes define the x and y coordinates of the center of the circle. If cx and cy are omitted, the circle's center is set to (0, 0) • The r attribute defines the radius of the circle • The stroke and stroke-width attributes control how the outline of a shape appears. We set the outline of the circle to a 4px green "border“ • • The fill attribute refers to the color inside the circle. We set the fill color to yellow • The closing </svg> tag closes the SVG image
  • 8. SVG ShapesSVG Shapes SVG has some predefined shape elements that can be used by developers: • Rectangle <rect> • Circle <circle> • Ellipse <ellipse> • Line <line> • Polyline <polyline> • Polygon <polygon> • Path <path> infobizzs.com
  • 9. SVG Rectangle - <rect>SVG Rectangle - <rect> • The <rect> element is used to create a rectangle and variations of a rectangle shape: • Here is the SVG code: infobizzs.com
  • 10. ExampleExample <svg width="400" height="110">   <rect width="300" height="100“ style="fill:rgb(0,0,255); stroke-width:3;stroke:rgb(0,0,0)" /> </svg> OutputOutput infobizzs.com
  • 11. Code explanation:Code explanation: • The width and height attributes of the <rect> element define the height and the width of the rectangle • The style attribute is used to define CSS properties for the rectangle • The CSS fill property defines the fill color of the rectangle • The CSS stroke-width property defines the width of the border of the rectangle • The CSS stroke property defines the color of the border of the rectangle infobizzs.com
  • 12. SVG Circle - <circle>SVG Circle - <circle> • The <circle> element is used to create a circle: • Here is the SVG code: infobizzs.com
  • 13. ExampleExample <svg height="100" width="100">   <circle cx="50" cy="50" r="40" stroke="black" stroke- width="3" fill="red" /> </svg> OutputOutput infobizzs.com
  • 14. Code explanation:Code explanation: • The cx and cy attributes define the x and y coordinates of the center of the circle. If cx and cy are omitted, the circle's center is set to (0,0) • The r attribute defines the radius of the circle infobizzs.com
  • 15. SVG Ellipse - <ellipse>SVG Ellipse - <ellipse> • The <ellipse> element is used to create an ellipse. • An ellipse is closely related to a circle. The difference is that an ellipse has an x and a y radius that differs from each other, while a circle has equal x and y radius: • The following example creates an ellipse: • Here is the SVG code: infobizzs.com
  • 16. ExampleExample • <svg height="140" width="500">   <ellipse cx="200" cy="80" rx="100" ry="50"   style="fill:yellow;stroke:purple;stroke-width:2" /> </svg> Output infobizzs.com
  • 17. Code explanation:Code explanation: • The cx attribute defines the x coordinate of the center of the ellipse • The cy attribute defines the y coordinate of the center of the ellipse • The rx attribute defines the horizontal radius • The ry attribute defines the vertical radius infobizzs.com
  • 18. SVG Line - <line>SVG Line - <line> • The <line> element is used to create a line: • Here is the SVG code: infobizzs.com
  • 19. ExampleExample <svg height="210" width="500"> <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" /> </svg> OutputOutput infobizzs.com
  • 20. Code explanation:Code explanation: • The x1 attribute defines the start of the line on the x- axis • The y1 attribute defines the start of the line on the y- axis • The x2 attribute defines the end of the line on the x- axis • The y2 attribute defines the end of the line on the y- axis infobizzs.com