0

If I have an object like this on a specific website:

<div class="header">
    <h1>Welcome to the site</h1>
    <p>Foo bar baz spam</p>
</div>

Is there a way to make an element on my site display the content of the first div with that class?

For example, on https://stackoverflow.com, there's a div with the class "-container" near the top of the page.

<header class="top-bar js-top-bar _fixed">
    <div class="-container">
        <div class="-main">

                <a href="https://stackoverflow.com" class="-logo js-gps-track"
                   data-gps-track="top_nav.click({is_current:true, location:1, destination:8})">
                    <span class="-img _glyph">Stack Overflow</span>
                </a>



         <!-- More data follows -->

So, on my site, let's say I had a special element with a certain class that specified the website and class to pull from. The HTML would look like this:

<div class="mySpecialClass">
    <div class="-main">

                    <a href="https://stackoverflow.com" class="-logo js-gps-track"
                       data-gps-track="top_nav.click({is_current:true, location:1, destination:8})">
                        <span class="-img _glyph">Stack Overflow</span>
                    </a>



             <!-- More data follows -->


</div>

Is there a way to do this with HTML, CSS, PHP or similar?

0 Answers0