2

I have embedded a TradingView Widget . I wanted to remove or hide the header area of that widget where TradingView icon and text are displayed.

I have used display: none !important on the specific class. But it doesn't resolve this.

TradingView Icon

Here is my JSFiddle Link: JSFiddle Link

Here is the embedding part:

              <!-- TradingView Widget BEGIN -->
<div class="tradingview-widget-container">
  <div class="tradingview-widget-container__widget"></div>
  <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-market-overview.js" async>
  {
  "showChart": true,
  "locale": "en",
  "largeChartUrl": "",
  "width": "400",
  "height": "660",
  "plotLineColorGrowing": "rgba(60, 188, 152, 1)",
  "plotLineColorFalling": "rgba(255, 74, 104, 1)",
  "gridLineColor": "rgba(233, 233, 234, 1)",
  "scaleFontColor": "rgba(218, 221, 224, 1)",
  "belowLineFillColorGrowing": "rgba(60, 188, 152, 0.05)",
  "belowLineFillColorFalling": "rgba(255, 74, 104, 0.05)",
  "symbolActiveColor": "rgba(242, 250, 254, 1)",
  "tabs": [
    {
      "title": "Indices",
      "symbols": [
        {
          "s": "INDEX:SPX",
          "d": "S&P 500"
        },
        {
          "s": "INDEX:IUXX",
          "d": "Nasdaq 100"
        },
        {
          "s": "INDEX:DOWI",
          "d": "Dow 30"
        },
        {
          "s": "INDEX:NKY",
          "d": "Nikkei 225"
        },
        {
          "s": "NASDAQ:AAPL",
          "d": "Apple"
        },
        {
          "s": "NASDAQ:GOOG",
          "d": "Google"
        },
        {
          "s": "MIL:FB",
          "d": "Facebook"
        }
      ],
      "originalTitle": "Indices"
    },
    {
      "title": "Commodities",
      "symbols": [
        {
          "s": "CME_MINI:ES1!",
          "d": "E-Mini S&P"
        },
        {
          "s": "CME:E61!",
          "d": "Euro"
        },
        {
          "s": "COMEX:GC1!",
          "d": "Gold"
        },
        {
          "s": "NYMEX:CL1!",
          "d": "Crude Oil"
        },
        {
          "s": "NYMEX:NG1!",
          "d": "Natural Gas"
        },
        {
          "s": "CBOT:ZC1!",
          "d": "Corn"
        }
      ],
      "originalTitle": "Commodities"
    },
    {
      "title": "Bonds",
      "symbols": [
        {
          "s": "CME:GE1!",
          "d": "Eurodollar"
        },
        {
          "s": "CBOT:ZB1!",
          "d": "T-Bond"
        },
        {
          "s": "CBOT:UD1!",
          "d": "Ultra T-Bond"
        },
        {
          "s": "EUREX:GG1!",
          "d": "Euro Bund"
        },
        {
          "s": "EUREX:II1!",
          "d": "Euro BTP"
        },
        {
          "s": "EUREX:HR1!",
          "d": "Euro BOBL"
        }
      ],
      "originalTitle": "Bonds"
    },
    {
      "title": "Forex",
      "symbols": [
        {
          "s": "FX:EURUSD"
        },
        {
          "s": "FX:GBPUSD"
        },
        {
          "s": "FX:USDJPY"
        },
        {
          "s": "FX:USDCHF"
        },
        {
          "s": "FX:AUDUSD"
        },
        {
          "s": "FX:USDCAD"
        }
      ],
      "originalTitle": "Forex"
    }
  ]
}
  </script>
</div>
<!-- TradingView Widget END -->  

How can i hide or remove that header area ?

7
  • Possible duplicate of How to apply CSS to iframe? Commented Mar 27, 2018 at 7:12
  • @NicoHaase I can't find solution from your given link. My iframe is not in the same page. It is coming from another source i.e. <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-market-overview.js" async> Commented Mar 27, 2018 at 8:32
  • Are you sure? In the given fiddle, the rendered iFrame is included in your base context. For CSS, it should behave in the same way Commented Mar 27, 2018 at 9:52
  • Yes, i have tried. Can you find out any solution by editing in my fiddle? @NicoHaase Commented Mar 27, 2018 at 11:01
  • Have you read the linked answer? CORS needs to be enabled by the provider of that iFrame. And if that is not enabled, there might be a good reason for it ;) This exposes huge security vulnerabilities for the embedded page Commented Mar 27, 2018 at 11:04

1 Answer 1

2

Some one gave me a solution and it works .

CSS:

.tradingview-widget-container {
  position: relative;
}
.tradingview-widget-container:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 34px;
  background-color: #fff;
} 

New JSFiddle Link: JSFiddle

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.