出于某种原因我的css根本不想工作。 DIV只是不想按照我声明它们的方式对齐。如果显示某些文本,它基本上只是环绕文本。它根本不像普通的css文件一样调整页面。
我的css如下所示:
body {
height: 95%;
width:100%;
margin:0 auto;}
#HEADER{
height: 15%;
width: 100%;
border-bottom: 2px solid black;}
#CONTAINER{height:85%;}
#CONTENT{
height:100%;
border-left: 2px solid black;
}
CSS应该控制以下div
<body>
<div id="HEADER">
TITLE HERE
</div>
<div id="CONTAINER">
<div id="MENU">
</div>
<div id="CONTENT">
<asp:ContentPlaceHolder ID="CPH_Content" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="FOOTER">
</div>
</div>
我已经在头部宣布了我的css,如下所示:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Labo 2</title>
<link href="/CSS/main.css" rel="stylesheet" type="text/css"/>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
我也尝试过 href =“〜/ CSS / main.css”而没有任何运气。
据我所知,外部页面没有任何形状或形式的安全保护,但为了确保我在web.config中声明了以下内容以确保它是可访问的
<location path="CSS">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
任何人都可以给我一些帮助或一些急需的解释,我称之为的任何JavaScript都像魅力一样,只有css才真正让我感到厌烦。
谢谢!
答案 0 :(得分:1)
好吧,我已经找到了问题
为了让%值启动,我必须声明html标记,而不仅仅是css文件中的body标记。
现在一切都很完美!谢谢你的帮助!
像这样:public class YoutubeActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener{
public static final String API_KEY = "xxxxxxxxxx";
public static final String VIDEO_ID = "xxxxxxx";
private YouTubePlayer youTubePlayer;
private YouTubePlayerFragment youTubePlayerFragment;
private TextView textVideoLog;
private Button btnViewFullScreen;
private static final int RQS_ErrorDialog = 1;
private MyPlayerStateChangeListener myPlayerStateChangeListener;
private MyPlaybackEventListener myPlaybackEventListener;
String log = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
youTubePlayerFragment = (YouTubePlayerFragment)getFragmentManager()
.findFragmentById(R.id.youtubeplayerfragment);
youTubePlayerFragment.initialize(API_KEY, this);
textVideoLog = (TextView)findViewById(R.id.videolog);
myPlayerStateChangeListener = new MyPlayerStateChangeListener();
myPlaybackEventListener = new MyPlaybackEventListener();
btnViewFullScreen = (Button)findViewById(R.id.btnviewfullscreen);
btnViewFullScreen.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View arg0) {
youTubePlayer.setFullscreen(true);
}});
Button btnPlay = (Button) findViewById(R.id.btnplay);
btnPlay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(youTubePlayer.isPlaying())
youTubePlayer.pause();
else
youTubePlayer.play();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_splash_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
Log.e("id", id+"");
switch(item.getItemId()){
case R.id.action_share:
break;
case 16908332:
onBackPressed();
break;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youtube, boolean b) {
youTubePlayer = youtube;
Toast.makeText(getApplicationContext(), "YouTubePlayer.onInitializationSuccess()", Toast.LENGTH_LONG).show();
youtube.setPlayerStateChangeListener(myPlayerStateChangeListener);
youtube.setPlaybackEventListener(myPlaybackEventListener);
if (!b) {
youTubePlayer.cueVideo(VIDEO_ID);
}
}
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
if (youTubeInitializationResult.isUserRecoverableError()) {
youTubeInitializationResult.getErrorDialog(this, RQS_ErrorDialog).show();
} else {
Toast.makeText(this,"YouTubePlayer.onInitializationFailure(): " + youTubeInitializationResult.toString(),Toast.LENGTH_LONG).show();
}
}
private final class MyPlayerStateChangeListener implements YouTubePlayer.PlayerStateChangeListener {
private void updateLog(String prompt){
log += "MyPlayerStateChangeListener" + "\n" +prompt + "\n\n=====";
textVideoLog.setText(log);
};
@Override
public void onAdStarted() {
updateLog("onAdStarted()");
}
@Override
public void onError(
com.google.android.youtube.player.YouTubePlayer.ErrorReason arg0) {
updateLog("onError(): " + arg0.toString());
}
@Override
public void onLoaded(String arg0) {
updateLog("onLoaded(): " + arg0);
}
@Override
public void onLoading() {
updateLog("onLoading()");
}
@Override
public void onVideoEnded() {
updateLog("onVideoEnded()");
}
@Override
public void onVideoStarted() {
updateLog("onVideoStarted()");
}
}
private final class MyPlaybackEventListener implements YouTubePlayer.PlaybackEventListener {
private void updateLog(String prompt){
log += "MyPlaybackEventListener" + "\n-" +
prompt + "\n\n=====";
textVideoLog.setText(log);
};
@Override
public void onBuffering(boolean arg0) {
updateLog("onBuffering(): " + String.valueOf(arg0));
}
@Override
public void onPaused() {
updateLog("onPaused()");
}
@Override
public void onPlaying() {
updateLog("onPlaying()");
}
@Override
public void onSeekTo(int arg0) {
updateLog("onSeekTo(): " + String.valueOf(arg0));
}
@Override
public void onStopped() {
updateLog("onStopped()");
}
}