如何增加我的Twitter Feed

时间:2015-12-18 12:26:40

标签: javascript html css

我正在尝试增加我网页上显示的Twitter Feed的宽度,我为它添加了一个Div ID并尝试在css中增加它的大小,但是在某个点之后它会停止变大,同时我想添加图像我的投资组合部分包括3个随机图片的类似计算机,当你将它们悬停在css上时它们会变大并改变大小,我该怎么做?另外我无法弄清楚如何改变网页背景的颜色,我尝试的一切都行不通。感谢。

我已经为下面的代码提供了HTML,CSS和JS代码。

<!DOCTYPE html>
<html lang="en">

<head>
    <title>Muhammed's Webpage</title>

    <style>
        #body {
            margin: auto;
            max-width: 85%;
            font-family: 'Exo 2', Times, serif;
            color: black;
            padding-top: 50px;
        }

        .mainlogo {
            font-size: 18px;
            font-weight: 900;
            font-family: 'Montserrat', Times, serif;
            text-decoration: underline;
        }

        nav {
            position: fixed;
            top: 0;
            width: 100%;
            margin-left: 4%;
            opacity: 0.8;
            max-width: 85%;

        }

        ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            overflow: hidden;
            background-color: white;
            position: fixed;
            font-size: 20px;
        }

        li {
            float: left;
            border-right: 2px solid black;
        }

        li:first-child {
            border-left: 2px solid black;
        }

        li a {
            display: inline-block;
            color: black;
            text-align: justify;
            padding: 36px 40px;
            text-decoration: underline;
            font-family: 'Montserrat', Times, serif;
            text-shadow: 4px 4px 4px #aaa;
        }

        li a:hover {
            background-color: #C2E5E5;
            color: black;
        }

        .yt {
            margin-left: 53px;
            margin-top: 30px;
            display: inline-block;
            height: 500px;
            width: 650px;
        }

        #twitter {
            display: inline-block;
            height: 300px;
            width: 300px;
        }

        .contentbox {
            font-family: 'Exo 2', sans-serif;
            font-weight: 700;
            font-size: 2em;
            padding-left: 10px;
            padding-bottom: 0;
            margin-bottom: 0;
            background-color: #C2E5E5;
        }

        .content {
            background-color: #C2E5E5;
        }

        p {
            text-indent: 3%;
            margin: auto;
            max-width: 95%;
        }

        .contentbox {
            font-family: 'Montserrat', Times, serif;
            font-size: 28px;
        }
    </style>
    <script>
        !function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
            if (!d.getElementById(id)) {
                js = d.createElement(s);
                js.id = id;
                js.src = p + "://platform.twitter.com/widgets.js";
                fjs.parentNode.insertBefore(js, fjs);
            }
        }(document, "script", "twitter-wjs");
    </script>
</head>
<body>
<div class="mainlogo">

    <div>Muhammed's
        <br>Webpage
    </div>

</div>

<div id="body">

    <nav>
        <ul>

            <li><a href="#BasicInfo"> BASIC INFORMATION </a></li>
            <li><a href="#CurriculumVitae"> CURRICULUM VITAE </a></li>
            <li><a href="#Portfolio"> PORTFOLIO </a></li>
            <li><a href="#Report"> REPORT </a></li>
        </ul>
    </nav>

    <div class="yt">
        <iframe src="http://www.youtube.com/embed/nKIu9yen5nc">
        </iframe>
    </div>

    <div id="twitter">
        <a class="twitter-timeline" href="https://twitter.com/applenws" data-widget-id="674678491141570560">Tweets by
            @applenws</a>
    </div>

    <div class="content" id="Basic Information">
        <h3 class="contentbox"><u>Basic Information</u></h3>
        <p>
            <br>Name: Muhammed Hussain
            <br>Age: 18
            <br>Contact Number: 07711909673
            <br>E-mail: Mhuss055@gold.ac.uk
            <br>Occupation: Student of Goldsmiths, University of London
            <br>Hobbies & Interests: Playing on my ps4 and outdoor tennis
            <br>
            <br>
        </p>
    </div>

    <div class="content" id="Curriculum Vitae">
        <h3 class="contentbox"><u>Curriculum Vitae</u></h3>
        <p>
            <br><u>Jun 2015 - Currently Employed</u> : <b>Harrods - Operations Assistant</b>
            <br>Responsible for ensuring all daily administrative tasks are met within time schedule
            <br>Worked with colleagues to sustain a world class service of luxury goods, through providing an excellent
            service while working in a team environment and focusing on customer service
            <br>Proactive use of CCA and SAP software on a regular basis, in order to deal with online orders.
            <br>
            <br><u>Jun 2014 - Sep 2014</u> : <b>Direct Accountancy - Accounts Assistant</b>
            <br>Assisted Account Manager through creating invoices and sending to customers using SAGE software
            <br>Made and arranged invoices occasionally for customers, and ensured these were sent out promptly upon
            receiving the order.
            <br>
            <br>
            <u>Skills Gained:</u>
            <br>Communication - Established rapport and resolved queries within pressurised customer service
            environments
            <br>Teamwork - Motivated and developed colleagues to work effectively
            <br>Leadership - Showed leadership qualities when delivering end of unit presentations at Sixth form
            <br>
            <br>
        <p>
    </div>

    <div class="content" id="Portfolio">
        <h3 class="contentbox"><u>Portfolio</u></h3>
        <p>
            <br>Here im going to include some images and use css to make them interactive and exciting
            <br>
            <br>
        </p>
    </div>


    <div class="content" id="Report">
        <h3 class="contentbox"><u>Report</u></h3>
        <p>
            <br>Here im going to state why i did what i did in detail
        <p>
            <br>
    </div>

    <br>
    <br>
</div>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

试试此代码。

twitter帧有max-width =“520”这是一个border.portfolia图像也支持响应。

让我感觉很酷,我们喜欢我们的编码。

<!DOCTYPE html>
<html lang="en">

 <head>
  <title>Muhammed's Webpage</title>

  <link rel="stylesheet" type="text/css" href="homepage.css">
  <script src="homepage.js"></script>

  <link href='https://fonts.googleapis.com/css?family=Exo+2:500,700,800italic,600|Montserrat' rel='stylesheet' type='text/css'>

 </head>

 <div class="mainlogo">

  <body>Muhammed's 
   <br>Webpage</body>

  </div>

   <div id="body">

    <nav>
      <ul>

        <li><a href="#BasicInfo"> BASIC INFORMATION </a></li>
        <li><a href="#CurriculumVitae"> CURRICULUM VITAE </a></li>
        <li><a href="#Portfolio"> PORTFOLIO </a></li>
        <li><a href="#Report"> REPORT </a></li>
      </ul>
    </nav>

    <div class="yt">
      <iframe  src="http://www.youtube.com/embed/nKIu9yen5nc">
      </iframe>
    </div>

   <div id = "twitter">
    <a class="twitter-timeline" href="https://twitter.com/applenws" data-widget-id="674678491141570560">Tweets by @applenws</a>
   </div>

    <div class="content" id="Basic Information">
      <h3 class="contentbox"> <u>Basic Information</u> </h3>
      <p>
        <br>Name: Muhammed Hussain 
        <br>Age: 18 
        <br>Contact Number: 07711909673
        <br>E-mail: Mhuss055@gold.ac.uk
        <br>Occupation: Student of Goldsmiths, University of London
        <br>Hobbies & Interests: Playing on my ps4 and outdoor tennis
        <br>
        <br>  
      </p>
    </div>

    <div class="content" id="Curriculum Vitae">
      <h3 class="contentbox"> <u>Curriculum Vitae</u> </h3>
      <p>
        <br><u>Jun 2015 - Currently Employed</u> : <b>Harrods - Operations Assistant</b> 
        <br>Responsible for ensuring all daily administrative tasks are met within time schedule
        <br>Worked with colleagues to sustain a world class service of luxury goods, through providing an excellent service while working in a team environment and focusing on customer service
        <br>Proactive use of CCA and SAP software on a regular basis, in order to deal with online orders.
        <br>
        <br><u>Jun 2014 - Sep 2014</u> : <b>Direct Accountancy - Accounts Assistant</b>
        <br>Assisted Account Manager through creating invoices and sending to customers using SAGE software
        <br>Made and arranged invoices occasionally for customers, and ensured these were sent out promptly upon receiving the order.
        <br>
        <br>
        <u>Skills Gained:</u>
        <br>Communication - Established rapport and resolved queries within pressurised customer service environments
        <br>Teamwork - Motivated and developed colleagues to work effectively
        <br>Leadership - Showed leadership qualities when delivering end of unit presentations at Sixth form 
        <br>
        <br> 
      <p>
    </div>

    <div class="content" id="Portfolio" style="height:250px">
      <h3 class="contentbox"> <u>Portfolio</u> </h3>
      <p>
        <br>Here im going to include some images and use css to make them interactive and exciting
        <br>
        <br>
      </p>

      <ul class="portfolioimg" style="">
         <li><img src="https://getbootstrap.com/assets/img/devices.png" alt="Responsive across devices" class="img-responsive"></li>
         <li><img src="https://getbootstrap.com/assets/img/devices.png" alt="Responsive across devices" class="img-responsive"></li>
         <li><img src="https://getbootstrap.com/assets/img/devices.png" alt="Responsive across devices" class="img-responsive"></li>

      </ul>

    </div>


    <div class="content" id="Report">
      <h3 class="contentbox"> <u>Report</u> </h3>
      <p>
        <br>Here im going to state why i did what i did in detail
      <p>
        <br>
    </div>

        <br>
        <br>

  </body>

</html>


<style>
body{
  background-color:gray;
}


.portfolioimg {
    clear: both;
    display: block;
     margin: 30px auto 0;
    padding: 0;
    position: static !important;
    text-align: center;
    width: 1000px;
    background-color:transparent;
}
.portfolioimg > li {
    background-color: transparent !important;
    border: medium none !important;
    display: inline-block;
    float: none;
    list-style-type: none;
    margin-right: 40px;
    text-align: center;
}
.portfolioimg > li img{
  width:200px;
  }

#body {


    margin: auto;
    max-width: 85%; 
    font-family: 'Exo 2', Times, serif;
    color: black;
    padding-top: 50px;
}

.mainlogo {
    font-size: 18px;
    font-weight: 900;
    font-family: 'Montserrat' , Times, serif;
    text-decoration: underline;
}
nav {
    position: fixed; 
    top: 0;  
    width: 100%;
    margin-left: 4%;
    opacity: 0.8;
    max-width: 85%;

}
ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: white;
    position: fixed;
    font-size: 20px;
}
li {
    float: left;
    border-right: 2px solid black;
}

li:first-child {
    border-left: 2px solid black;
}
li a {
    display: inline-block;
    color: black;
    text-align: justify;
    padding: 36px 40px; 
    text-decoration: underline; 
    font-family: 'Montserrat', Times, serif;
    text-shadow: 4px 4px 4px #aaa ;
}
li a:hover {
    background-color: #C2E5E5;
    color: black; 
}

.yt {
  margin-left: 53px;
  margin-top: 30px;
  display:inline-block;
  height: 500px;
  width: 650px;
} 

#twitter {
  display:inline-block;
  height: 300px;
  width: 520px;
}

.contentbox {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 2em;
    padding-left: 10px;
    padding-bottom: 0;
    margin-bottom: 0;
    background-color:  #C2E5E5;
}
.content {
    background-color: #C2E5E5;
}
p {
    text-indent: 3%; 
    margin: auto;
    max-width: 95%;
}

.contentbox {
    font-family: 'Montserrat', Times, serif;
    font-size: 28px;
}
</style>

<script>
!function(d,s,id){
    var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
    if(!d.getElementById(id)){
        js=d.createElement(s);
        js.id=id;
        js.src=p+"://platform.twitter.com/widgets.js";
        fjs.parentNode.insertBefore(js,fjs);
    }
}(document,"script","twitter-wjs");
</script>