我可以在图中放置徽标吗?

时间:2015-12-14 06:57:20

标签: html5 twitter-bootstrap figure

我可以将徽标嵌套在<header> <div class="row"> <figure class="col-sm-5"> <a href="index.html" class="logo"> <img src="images/logo.gif" class="img-responsive" height="60" width="330" alt="site-logo"> </a> </figure> <div class="col-sm-7"> <div class="well"> <div class="row"> <div class="col-xs-9"><nav></nav></div> <figure class="col-xs-3"> <img src="images/helpline.gif" class="img-responsive" height="60" width="120" alt="helpline-image"> </figure> <div class="clearfix"></div> </div> </div> </div> <div class="clearfix"></div> </div> </header> 内吗?是不是? 这是代码

UIImagePickerController *picker;
    if([self checkForCameraAcess]) 
    { 
    picker = [[UIImagePickerController alloc] init]; 
    picker.delegate = self; 
    picker.sourceType = UIImagePickerControllerSourceTypeCamera; 
    [self presentViewController:picker animated:YES completion:nil]; 
    } 
    else 
    { 
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Camera",nil) message:NSLocalizedString(@"Access to camera seems to be turned off. Please enable it from settings",nil) delegate:self cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:NSLocalizedString(@"Settings",nil), nil]; 
    alert.tag = 101; 
    [alert show]; 
    }    

-(BOOL)checkForCameraAcess
{
    BOOL isAccess = YES;
    if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1)
    {
        AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];

        //Here we check condition for AVAuthorizationStatusNotDetermined, because when user install iLeads app first time in device (Nerver before iLeads app install in Device), then setup an event and tap on the scan button, at that time authStatus is AVAuthorizationStatusNotDetermined so its show alert for camera acess first. Then after our custom alert shows if we tap on 'Dont allow' button of the camera acess.
        if(authStatus == AVAuthorizationStatusAuthorized || authStatus == AVAuthorizationStatusNotDetermined)
        {
            isAccess = YES;
        }
        else
        {
            isAccess = NO;
        }
    }
    return isAccess;
}

3 个答案:

答案 0 :(得分:2)

为了更好的SEO,请将您的徽标放在H2标签内。

<h2>
   <a href="#">
      <img src="logo.gif" alt="stackoverflow-logo"/> 
   </a>
</h2>

为替代文字标记alt提供正确的名称,而不是网站徽标,请提供您的companyname-logo

答案 1 :(得分:2)

是的,你可以。

  

HTML <figure>元素表示自包含内容,通常带有标题(<figcaption>),通常作为单个单元引用。虽然它与主流有关,但其位置与主流无关。通常这是一个图像,插图,图表,代码片段或主文本中引用的模式,但可以移动到另一个页面或附录而不影响主流。

参考:MDN

答案 2 :(得分:1)

我知道这很旧了,但是请不要将您的徽标放在<h2>中;它不是放置它的地方,它可能会破坏您的可访问性,dom标题结构和SEO性能。因为您可能会做一些事情,但并不能使其成为正确的解决方案。下面是一些有关如何使用标题标签的链接。如果您希望它看起来像<h2>,请在CSS中对其进行样式设置。

W3 Schools

MDN

SEO and Headers Article

相关问题