Javascript 页面格式
请注意,我不懂HTML,我正在尝试学习。这么说吧,我有一个网页,我正在为我的女朋友做圣诞礼物。我想把我在页面右侧的文本放大,并且只扩展300px的量,这样改变的图片就在它的左侧,你不必向下滚动就能看到所有的图片Javascript 页面格式,javascript,html,Javascript,Html,请注意,我不懂HTML,我正在尝试学习。这么说吧,我有一个网页,我正在为我的女朋友做圣诞礼物。我想把我在页面右侧的文本放大,并且只扩展300px的量,这样改变的图片就在它的左侧,你不必向下滚动就能看到所有的图片 <!DOCTYPE html> <html> <Head> <title>Heather I Love You!</title> </head> <body style= background-color:#A
<!DOCTYPE html>
<html>
<Head>
<title>Heather I Love You!</title>
</head>
<body style= background-color:#A8A8A8>
<!========This is the header===========>
<div id="header" style= "background-color:#00FF33;" >
<h1><p id="hheader"></p></h1></div>
<!=============The side bar that will allow a list of where she Wants to go==========>
<div align="right"><i><p id="phrases" style="text-height="50" width:300px></p></i></div>
<div id="Menu" Style="background-color:#3A75D4;height:300px;width:125px;float:left;">
<div align="center"><img id="cur_pic" height="400" src="pictures/cake.jpg" /></div>
<button type="button" onclick="ChangeHead()">Next Picture</button><br>
<!--Functions-->
<Script>
function ChangeHead(){
var g = document.getElementById("hheader");
var x = "Heather this is a series of Pictures, Videos, and Poems to show you the love that I have for you!";
var boys = "Here are some pictures of us and the boys";
var cake = document.getElementById("cur_pic");
var fam = "I Love spending the time that we get together, even when I have a Broken foot";
var poems = document.getElementById("phrases");
var cakepoem = "Here are some of my favorite times that I have with you. Doing the date Night is a great time that I really enjoy with you. I cant wait until we can spend a week together in North Carolina, yes we'll be with your mother, but the best part about it will be that we will be together!";
var boyspoem = "Jenner and Watson are a big Part of our life, Jenner says momma I love you and can I have some food?";
var fampoem = "Honey, when I see this picture of you and the kids, well, it shows me all the love that you have for me and the family.";
if (g.innerText == fam) {
g.innerHTML = x;
cake.src = "pictures/cake.jpg"; poems.innerHTML = cakepoem ;
} else if (g.innerText == x) {
g.innerHTML = boys;
cake.src = "pictures/jenner wanting to pee.jpg"; poems.innerHTML = boyspoem;}
else {
g.innerHTML = fam;
cake.src = "The Family and Friends/H_Jules_bre_at_zoo.jpg";poems.innerHTML = fampoem;
}
};
ChangeHead();
</Script>
</body>
</Html>
'
这应该让你开始: Css可以通过在头部添加样式标记包含在代码中:
<style type="text/css">
/* css goes here */
</style>
这是一个糟糕的代码,但它会为您将元素置于合适的位置
要学习html,请访问此处:
Css:
w3c学校并不是最好的资源,但它有大部分的基础知识,对初学者来说很容易理解
另外,对于javascript,您希望仅在需要时动态加载内容。在大多数情况下,您可以将内容粘贴到html中,然后在需要时进行更改。Javascript在这方面做得很好。不过,如果您想学习更简单的界面,请查看
祝你好运!我两年前就做了这件事。圣诞节时,图片查看器使用我对html的初步理解为我的女朋友。现在我是一名专业的php开发人员 使用CSS。我不想使用HTML样式属性,这是JavaScript设置的。如果您正在这样做,那么使用JavaScript动态设置样式就可以了。此外,将所有HTML保持小写也是一个很好的做法,除了属性值(引号中的字符串)和DOCTYPE声明。学习HTML和CSS不应该花费太长时间。我喜欢书。祝你好运。好的,我会使用CSS,请告诉我应该去哪里解决这个问题。虽然这个网站上的很多人会说远离学校,但我发现这些信息很容易理解,而且通常是准确的。前5章左右应该给你一个良好的开端。当然,您应该先学习HTML。同一页上有一个链接。我会学习XHTML,这样你就可以把你的代码转移到任何网站上。因为我今晚没什么要做的,所以我给你写了这样一封信:希望它能有所帮助。要完成它,请看一眼W3学校,否则太棒了!我对它很陌生,但我已经花了几个小时在互联网上研究这个网站,我能够建立网站并运行感谢页面上的提示,我做了更多的阅读,然后我更新它。再次感谢!当然可以还有一个关于堆栈溢出的提示——如果这个答案有帮助,请继续向上投票。如果它解决了您的问题,请将其标记为已接受。