尝试编辑 TradingView 小部件的位置

Trying to edit the position of TradingView widget

我对编程还很陌生。我正在尝试编辑 TradingView 小部件的位置。它会自动居中显示在屏幕上,我希望它位于左侧。如何通过 CSS?As you can see from my image attached, I would like the widget to be at the start of the black line at the top

执行此操作

没有必要用CSS,这是一个非常简单的解决方案,可以在小部件的标签内完成。

我假设这是您从 Tradingview.com:

中引用的小部件
<!-- TradingView Widget BEGIN -->
<div class="tradingview-widget-container">
  <div id="tradingview_d85a3"></div>
  <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/NASDAQ-AAPL/" rel="noopener" target="_blank"><span class="blue-text">AAPL Chart</span></a> by TradingView</div>
  <script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
  <script type="text/javascript">
  new TradingView.widget(
  {
  "autosize": true,
  "symbol": "NASDAQ:AAPL",
  "interval": "D",
  "timezone": "Etc/UTC",
  "theme": "dark",
  "style": "1",
  "locale": "en",
  "toolbar_bg": "#f1f3f6",
  "enable_publishing": false,
  "allow_symbol_change": true,
  "container_id": "tradingview_d85a3"
}
  );
  </script>
</div>
<!-- TradingView Widget END -->

在这种情况下,您需要在小部件的 div 中添加 align="left",因此您最终会在小部件的开头添加 <div class="tradingview-widget-container" align="left">