整个网站的CSS相同,但文字粗体会发生变化

时间:2017-12-08 17:49:22

标签: html css

我的设计方面有问题。我有一个main.css和几个html页面,如index.html,contact.html和其他。它们都在一个文件夹中,它们都正确地链接到main.css。最后,我使用的是谷歌字体。所以在index.html中,我的文字看起来很漂亮:

Here is what I want text to look like in other pages

但我在其他页面得到的是:

This is what it looks like in other pages

我知道这不是一个很大的区别,但我希望文本在整个网站中看起来一致。

以下是我认为重要的CSS部分:

/* This is what makes it look like what I want */
content #turinys{
  position: absolute;
  margin: 25vh 3.5vw 5vh 7vw;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  z-index: -1;
}

content #turinys h1{
  font-size: 12vh;
  color: #F57C00;
}

content #turinys h2{
  font-size: 8vh;
}


/* This is what I made in other page */

content #kontaktai{
  position: absolute;
  margin: 15vh 3.5vw 5vh 7vw;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  float: left;
}

content #kontaktai h2{
  font-size: 8vh;
}

我知道font-size是不同的,但是当我试图使它变得相同时,它仍然没有使文本看起来相同。

有人可以帮忙吗?

更新:这是我的HTML页面,其中包含所有内容。

<content>
  <div id="turinys">
    <h2>Hi, I am</h2><br>
    <h1>Arminas,</h1><br>
    <h2>a Web Developer.</h2>
    <p>This is my portfolio. Currently working with <span>HTML</span>, <span>CSS</span>, <span>JavaScript</span>. Going to learn <span>PHP</span>, <span>SQL</span>, <span>Python</span>.<br>
      Studying at Vilniaus Gediminas technical university. Multimedia and Computer Design.<br>
      <span>Passionate</span> about web design and development. Want to make all the <span>internet</span> look good.</p>
    <form action="contact.html">
      <input type="submit" value="CONTACT ME" />
    </form>
  </div>
  <div id="turinysImg">
    <img src="logo.png">
  </div>
</content>

这是HTML代码,没有任何意义。

<content>
  <div id="kontaktai">
    <h2 class="noselect">I am based in
    <span>Vilnius</span></h2><br><br>
    <p class="noselect"><span>Contact</span> me if you want to <span>work</span> or <span>discuss</span> something with me:</p><br><br>
    <form>
      <input type="text" name="vardas" placeholder="Name">
      <input type="text" name="telefonas" placeholder="Phone Number"><br><br>
      <input type="email" name="email" placeholder="Email"><br><br>
      <textarea rows="16" cols="64" placeholder="Your message"></textarea>
    </form>
  </div>
  <div id="map"></div>
</content>

求助:

很好,我太快了,没有尝试任何可以改变某些事情的东西,就提出问题。

所以问题是我在那里有谷歌地图,不知何故他们干扰了该页面上的其他CSS。当我发现它改变了文本的位置时,我会更新这个。

0 个答案:

没有答案