Reusing Graphical Objects from External Sources | SVG

Understanding External Sources

When creating responsive web designs, it’s often beneficial to reuse graphical objects from external sources to save time and effort. These sources can include:

  • Icon libraries: Websites like Font Awesome, Material Icons, and Ionicons provide a vast collection of icons that can be easily integrated into your designs.
  • Image libraries: Websites like Unsplash, Pixabay, and Pexels offer high-quality images that can be used for various purposes.
  • SVG libraries: Libraries like Iconify provide a collection of SVG icons that can be easily customized and integrated into your designs.

Methods of Reusing External Graphical Objects

Embedding directly: Embed the graphical object directly into your HTML using an <img> tag or SVG code.
Example (using an image):
HTML
<img src=”https://example.com/image.jpg” alt=”Image”>


Example (using SVG):
HTML
<svg width=”200″ height=”200″>

  <use xlink:href=”https://example.com/symbol.svg#my-symbol” />

</svg>

Using a JavaScript library: Libraries like jQuery or JavaScript’s DOM API can be used to dynamically load and manipulate external graphical objects.
Example (using jQuery):
JavaScript
$(document).ready(function() {

  $(‘.my-element’).append(‘<img src=”https://example.com/image.jpg”>’);

});

Best Practices

  • Consider licensing: Ensure you have the necessary permissions to use external graphical objects.
  • Optimize images: Compress images to reduce file size and improve performance.
  • Use relative units: Use em or rem for dimensions to create responsive layouts.
  • Test on various devices: Ensure that the graphical objects display correctly on different screen sizes and browsers.
  • Consider accessibility: Provide appropriate alt text for images and ensure that SVGs are accessible to users with disabilities.

Reusing graphical objects from external sources can save time and effort when creating responsive web designs. By following these best practices, you can effectively incorporate external content into your projects while maintaining a high level of quality and accessibility.

Re-coloring SVGs with CSS Custom Properties | SVG
Coloring SVGs with mask-image | SVG

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?